Using heredoc in PHP
<?php
echo <<<EOT
<h1>This will display as an h1</h1>
<p>I can use "double quotes"</p>
<h1>and 'single quotes',
<p>plus $variables too, which will
be properly converted to their values,
you can even type EOT.</p>
<p>Make sure your opening EOT has no spaces after it,
and the closing EOT has no spaces infront of it!</p>
EOT;
?>
0 comments:
Post a Comment