Just as a side note, if you're not putting variables directly in strings, it's best to use single quotes. PHP won't parse variables in single quotes, so the load on the server is less and the parse time is less.
Now, typically I use all single quotes for two reasons:
1.) Speed. It's just faster.
2.) Dinstinguishable variables.
Is it better to see code like this:
<?php
echo "<html>
<head>
<title>How's my little brother?</title>
<script language=\"JavaScript\" type=\"text/javascript\"><!--
function showString(str) {
alert(\"This is a message from the {$_GET[name]}:\n\"+str);
}
--></script>";
Or would it be easier to do this:
<?php
echo '<html>
<head>
<title>How\'s my little brother?</title>
<script language="JavaScript" type="text/javascript"><!--
function showString(str) {
alert("This is a message from the '.$_GET[name].':'."\n"+str);
}
--></script>';
There are downsides to using single quotes, but for the most part, it tends to make for cleaner and quicker code.
HereDoc is touchy, and I haven't had too much success with it. It's just as easy to drop out of PHP and write the html as it is to do HEREDOC syntax.