Re: echo or print
| From: | Eugene Lee | Date: | Sat, 22 Nov 2003 02:14:00 +0000 |
| Subject: | Re: echo or print | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-170651@lists.php.net to get a copy of this message | ||
On Fri, Nov 21, 2003 at 07:55:05PM +0100, Wouter van Vliet wrote:
:
: (.. long bunch of HTML ..)
: Jay asked <?=$Question?>, then Tom said <? echo $Answer; ?>. <?php
I don't like this because it doesn't protect your content from being
misinterpreted. It should be more like:
Jay asked <?php echo htmlentities($Question); ?>, then...
Of course you could call htmlentities() on all of your variables in a
previouw block. But then you cannot use the variables again unless you
undo it with html_entity_decode(). It's a bit of a mess.
Also, I find inlining to be less flexible and less extensible than some
kind of template system.