Functions that return Values

That’s how easy a function can be made to do a series of operations by being influenced by parameters. We now focus on the area of having functions that returns a value, say the processing of a block of code or an operation done on a set of data.

Sample :

function add($a,$b)
{
$total = $a + $b;
return $total;
}
echo "1 + 15 =" . add(1,15);
?>


The output of the code would be:

1 + 15 = 16

Next we focus on forms and user input as we go on the fascinating world of the powers of PHP as a scripting language.

Comments are closed.