note 2590 deleted from function.print by jimw
| From: | jimw@php.net | Date: | Fri, 14 Dec 2001 20:20:40 +0000 |
| Subject: | note 2590 deleted from function.print by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22728@lists.php.net to get a copy of this message | ||
For the lovers of the Perl syntax: print <<end_of_print;
I think that in PHP it can be done very easily. For
example, this code in Perl:
<pre>
$name = "aName";
$email = "anEmail";
print <<end_of_print;
Name = $name
Email = $email
end_of_print
</pre>
in PHP can be done in this way:
<pre>
<?
$name = "aName";
$email = "anEmail";
?>
Name = <?echo $name?>
Email = <?echo $email?>
</pre>
In Perl the code is the normal state and you escape
the output; in PHP the output is the normal state
and you escape the code.