note 13201 modified in function.print.php by philip
| From: | philip@php.net | Date: | Tue, 24 Jul 2001 19:32:45 +0000 |
| Subject: | note 13201 modified in function.print.php by philip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15781@lists.php.net to get a copy of this message | ||
Besides sending characters to print, you can also asign it to a variable just like PERL.
// Example
$name = "Sifl and Olly";
$message = <<<EOM
Dear $name,
Thanks for all the laughs.
Sincerely,
Delicious Digital
EOM;
echo $message;
// Output
Dear Sifl and Olly,
Thanks for all the laughs.
Sincerely,
Delicious Digital
// Notes
This comes in handy when you are printing various messages in HTML that depend on certain
conditions. It will keep the format (tabs, spaces, etc.) that you type into the code. You can use
any terminator i.e. EOM EOF, Make sure there is no space after it or the parser will get mad.
http://www.php.net/manual/en/function.print.php.php