Posted by Michael on 12/03/07 00:54
MangroveRoot wrote:
> - SNIP -
> (Perl, sed, TECO, and probably others
> allow the programmer to specify an alternate character
> to quote the entire string, so that ordinary single *or* double quotes
> may be used inside the string with impunity.)
echo <<<EOI
<h1><img src="_images/_rock/Zacs+World.gif" alt="{$title}"></h1>
EOI
;
You could use the heredoc syntax?
However I only recommend it when you are using many single and double
quotes. In your example your string consists of only double quotes. I
would suggest doing:
echo '<h1><img src="_images/_rock/Zacs+World.gif" alt="' . $title .
'"></h1>';
You should consider using a template engine to keep business logic and
design separate. I recommend Smarty (smarty.php.net).
- Michael
[Back to original message]
|