RE: [PHP] echo or print

From: Date: Fri, 21 Nov 2003 19:00:30 +0000
Subject: RE: [PHP] echo or print
Groups: php.general 
Request: Send a blank email to php-general+get-170614@lists.php.net to get a copy of this message
Wouter van Vliet <mailto:wouter@springt.nl> on Friday, November 21, 2003 10:55 AM said: > Point is, which of the inline printing style is preferred by you > guyes. I tend to use <?=$Var?> a lot, since it reads easier but get > into struggles with myself when I do that multiple times in a row. Because of this I usually do the following: echo "<p>here is some text with a $variable in it.<br/>\n" ."And this is another like of text with a $variable1 in it.<br/>\n" ."And so on...<br/>\n" ."And so forth.</p>\n"; I also prefer <?= $variable ?> to <?php echo $variable; ?> except that for the sake of cross-system compatibility* I now choose to do <?php echo $variable; ?>. Chris. * What I mean by that is if I give my code to someone else I want it to work with as few changes as possible. Some php installs don't have <? ?> turned on (short tags?). -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/

« previous php.general (#170614) next »