if i want a function to return a alue how would i do it??
so if the function was
function add($num1,$num2) { $answer = $num1+$num2; }
How would imake it so the answer is returned as a value??
would
$value = $answer;
or
$value = add('2','2');
function blah( val1, val2 ){ return val1 + val2; }
$foo = blah( 1, 2 );
The latter : $value = add('2','2');
would work, you call the function to perform the task on values passed to it..
<? function add($num1,$num2) { $answer = $num1+$num2; return $answer; }
echo add(2,4); ?>