You cannot run PHP code within a string like that. It just doesn't work. As well, when you're "out" of PHP code (?>
), any text outside of the PHP blocks is considered output anyway, so there's no need for the echo
statement.
If you do need to do multiline output from with a chunk of PHP code, consider using a HEREDOC:
<?php
$var = 'Howdy';
echo <<<EOL
This is output
And this is a new line
blah blah blah and this following $var will actually say Howdy as well
and now the output ends
EOL;