nzrubin
asked on
function calling
hello Experts!
interesting question:
why if i call function like that:
echo "<table><tr><td>";
some_function($some_var);
echo "</td></tr></table>";
it output at the sell of the table.
but if i call function like that:
echo "<table><tr><td>".some_fun ction($som e_var)."</ td></tr></ table>";
it displays not in the table but somwhere at the page
?
interesting question:
why if i call function like that:
echo "<table><tr><td>";
some_function($some_var);
echo "</td></tr></table>";
it output at the sell of the table.
but if i call function like that:
echo "<table><tr><td>".some_fun
it displays not in the table but somwhere at the page
?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
in order for the concatenation to work, the function would have to be evaluated BEFORE the string is echoed, therefore, if the function uses it's own echo statement, instead of a return statement it will echo in the function first and then process the first echo statement
ASKER
thanks i got it :)