In the PHP documentation, the statement for Returning Values is as follows:
Values are returned by using the optional return statement. Any type may be returned, including lists and objects. This causes the function to end its execution immediately and pass control back to the line from which it was called.
What about when you are calling the function from within another function? For instance, say function A adds the string to any string submitted, and function B calls function A like so:
<?php
function A($var1){
$var1.="me2";
return $var1;
}
function B($var2){
$writethis=A($var2);
echo $writethis;
}
B("PRINTME!!!");
?>
As long as I didn't screw up either little function, the output should be:
PRINTME!!!me2
Is this true? Or Does function A return you to the line calling function B instead of returning you to the line you left off inside function B?
If I messed up my functions, I hope I at least gave you an idea of the question I am asking.