Chris W. Parker wrote:
> Wouter van Vliet <mailto:[EMAIL PROTECTED]>
>     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?).
> 

Well, there is an eye opener. I always thought that the <?=$Var?> printing
style was not influenced by short_open_tag, but now I did a test to be sure
about it and it turned out it does..

<quick test>
      1 <?php
      2 echo 'ini setting short_open_tag: '.ini_get('short_open_tag');
      3 ?>
      4
      5 Long open tags: <?php print 'OK'; ?>
      6 Short open tags <? print 'OK'; ?>
      7 Short print style <?='OK'?>
<output short_open_tags="On">
        ini setting short_open_tag: 1
        Long open tags: OK
        Short   open tags OK
        Short print style OK
</output>
<output short_open_tags="Off">
        ini setting short_open_tag:
        Long open tags: OK
        Short open tags <? print 'OK'; ?>
        Short print style <?='OK'?>
</output>
</quick_test>

Thanks!
Wouter

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to