Hello!
Noob EOT question:
I made a little EOT script to see how it works, and it doesn't work as it should.
Code:
<?php
$mystring = <<<EOT
This is some PHP text.
It is completely free
I can use "double quotes"
and 'single quotes',
plus $variables too, which will
be properly converted to their values,
you can even type EOT, as long as it
is not alone on a line, like this:
EOT;
print "$mystring";
?>
This doesn't work, I get an undefined variable where the $variables is used.. I thought that using the $ sign within the EOT string would allow free use of things such as $, ', and " without worrying?
However, when I do ti like this:
<?php
$mystring = <<<EOT
This is some PHP text.
It is completely free
I can use "double quotes"
and 'single quotes',
plus \$variables too, which will
be properly converted to their values,
you can even type EOT, as long as it
is not alone on a line, like this:
EOT;
print "$mystring";
?>
It works.
Am I doing something wrong, or is the site I am reading about EOT from incorrect?