In this php code I use the heredoc EOF to insert some javascript:
$room= <<<EOF
<script type="text/javascript" charset="utf-8">
test;
</script>
EOF;
when I try to echo $room it doesn’t appear:
echo "<li style=\"text-align: center;\"><img src=\"example.com\" width=\"264\" height=\"198\" alt=\"\" /> $room</li>";
($room doesn’t appear in the html).
however if I do the same with:
$room= <<<EOF
test;
EOF;
Then the word test gets echoed in my list html element.
EDIT – to clarify, nothing appears in the source of the html when I do the first echo attempt (the list appears, but no script tags or test inside it).
basically means nothing to javascript. I’d guess you want (in a sense of outputting anything at least):
If you literally want to display the script tag, try: