note 62291 added to language.types.string
| From: | ThePromenader at osu1 dot php dot net | Date: | Fri, 24 Feb 2006 08:28:46 +0000 |
| Subject: | note 62291 added to language.types.string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-104348@lists.php.net to get a copy of this message | ||
The Heredoc (<<<) syntax could be a solution to a problem I had, but it has a bit of a
'bug' (most probably because it was not intended to be used in the way I did).
In switching a site from HTML to PHP, I wanted to transform blocks of text, in retaining their
WYSWYG editor 'editibility,' into a variable that would be called in a template itself
called later in the page, in a form something like this:
<?php
$content = <<<CONTENT
?>
<table width="100%">
<tr>
<td>
Hominy hominy hominy hominy...
</td>
</tr>
</table>
<?php
CONTENT;
?>
...this works, but with one minor glitch: there appears at the beginning, before the <table>,
an extra "?>".
----
Server IP: 217.174.203.10
Probable Submitter: 81.65.112.73
----
Manual Page -- http://www.php.net/manual/en/language.types.string.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+62291
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+62291&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+62291&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+62291&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+62291&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+62291&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+62291&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+62291&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+62291&report=yes
Search -- http://master.php.net/manage/user-notes.php