0
I’ve been trying for a while but I can’t get the expected result, follow the example:
<?php
$titulo = "Título";
$foo = "foo";
function foo(){
$i = 1;
while($i <= 10){
echo $i++;
}
}
echo <<<EOT
<h1>{$titulo}</h1>
<p>Um texto qualquer</p>
<p>Chamada da função foo() {$foo()}</p>
EOT;
?>
Well in the example above, I have the function foo() with the return of a loop, so far so good, but when I call the function in HEREDOC, the result returns above the string, it does not return where the function was called, it returns at the beginning of the string, there is a way for me to solve this problem with HEREDOC?