note 2590 modified in print by ronabop
| From: | ronabop@php.net | Date: | Fri, 11 Aug 2000 17:53:36 +0000 |
| Subject: | note 2590 modified in print by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-1335@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.
http://www.php.net/manual/function.print.php