Isaac Bennetch on 30 Mar 2007 14:38:37 -0000 |
Okay, since I've run in to this before I figured I should clear the air regarding which is acceptable: <? or <?php PHP calls this "short_open_tag" and it's configurable in php.ini (elsewhere too, but we won't get in to that). For a long time everyone had them enabled and used <? to open their scripts. Then people realized that it conflicts with XML's <?xml ?> inline tags, so more hosts started switching to setting short_open_tag to 0, forcing the full open tag, <?php -- incidentally this also affects the short echo, <?=... in place of <?php echo... So as long as your server is configured for short open tags, you're okay, but most people I've heard from think one should use the long form "just in case" the code is deployed on a server where short tags are disabled or in case the option removed from PHP in the future. You can read essentially what I wrote above on the PHP site here: http://us3.php.net/ini.core. Incidentally, if you miss Microsoft, you can pretend you're coding in ASP by enabling asp_tags and using <% instead of <?. Determining why one would want to do that is left as an exercise to the reader. Hope this helps, ~isaac ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|