note 55067 deleted from tutorial.useful by betz
| From: | betz@php.net | Date: | Sun, 24 Jul 2005 15:46:52 +0000 |
| Subject: | note 55067 deleted from tutorial.useful by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-92382@lists.php.net to get a copy of this message | ||
Note Submitter: dont at mail dot me
----
It depends on what you want to do.
Escaping in fact is a little bit faster if I'm right (which I think I am :P ),
but if you have loads of variables than heredoc might be easier to type.
However, if you have just, let's say, three variables in a long text,
you can just use escaping, e.g.
<?php
$foo1 = "whatever";
$foo2 = "You're stupid";
$foo3 = "Yes I know";
?>
<u>This</u> is a useless sentence in which I need to print <?php echo $foo; ?>
which is pretty useless actually you see? What do you say of that?<br />
<?php echo $foo2; ?><br />
Oh yeah? Well... <?php echo $foo3; ?><br />
What a piece of useless code
<?php
//more PHP code
?>
PS: More info on the heredoc syntax:
http://www.php.net/manual/en/
language.types.string.php#language.types.string.syntax.heredoc