note 68878 deleted from language.types.string by colder
| From: | colder@php.net | Date: | Tue, 17 Oct 2006 18:32:56 +0000 |
| Subject: | note 68878 deleted from language.types.string by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-118654@lists.php.net to get a copy of this message | ||
Note Submitter: kamermans at teratechnologies dot net
----
If you want to use Dreamweavers syntax highlighting features in HEREDOC variables you can do it like
this:
<?php
$something = 'test';
$output = <<<EOFEOF
<!-- ?> -->
<table><tr><td>{$something}</td></tr></table>
<!-- <?php -->
EOFEOF;
?>
Since you're in a HEREDOC, PHP will ignore the '<?php' and '?>'
symbols and include them literally in the string, and the user's browser will ignore them
because they're in HTML comments, but Dreamweaver will think you're breaking out of the
PHP script and assume the string is HTML. Yay! Syntax highlighting in HEREDOCs!