On Mon, 2006-04-17 at 00:13 +0100, Paul Lautman wrote:[color=blue]
> I often see the former starting delimiter rather than the latter. Is there
> some rule about where the former can be used?
>
>[/color]
There is a setting in your php.ini file called short_open_tags . If it
is enabled, you can use <? instead of <?php. However, because xml also
uses the short tag <?, and for compatibility with different servers, it
is generally recommended that you use the longer <?php tag.
On Mon, 17 Apr 2006 00:13:32 +0100, Paul Lautman wrote:
[color=blue]
> I often see the former starting delimiter rather than the latter. Is there
> some rule about where the former can be used?[/color]
<? is a shortened version of <?php for programmers too lazy to type <?php.
As <? is configurable in the php.ini file and can be turned off, so it's
availablity on any given web server is not guarentied. So use it at your
peril.
Paul Lautman wrote:[color=blue]
> I often see the former starting delimiter rather than the latter. Is
> there some rule about where the former can be used?[/color]
On Mon, 17 Apr 2006 00:13:32 +0100, Paul Lautman wrote:[color=blue]
> I often see the former starting delimiter rather than the latter. Is there
> some rule about where the former can be used?[/color]
While I agree with CJ and Scott, there is a useful construct that can be
used with short tags (<?) and if your code is running on a server you
control (as can be the case for a lot of web developers, run clients code
on servers you control) it can make for easier to read code:
I have heard also that in PHP version 6 the <? will no longer be
listened for. Which disappoints me becuase I used to always use
<?=$var?> because it's nice shorthand for the alternative.
Comment