Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Parham's PHP Tutorials => Topic started by: NathanKP on October 18, 2007, 11:40:29 AM

Title: The short tag '<?' or the long tag '<?php' ?
Post by: NathanKP on October 18, 2007, 11:40:29 AM
Is it better to use the short PHP tag "<?" or the long PHP tag "<?php"?  I've seen both used quite extensively, but I noticed that web hosts have to enable the short tag in php.ini.  Is the short tag usually supported by web hosts, or should I use the long tag to be on the safe side?

NathanKP
Title: Re: The short tag '<?' or the long tag '<?php' ?
Post by: codenaught on October 18, 2007, 11:41:52 AM
I would definitely recommend using <?php. I've never had problems with it, but I will tell you I have had problems using the <? tag before.
Title: Re: The short tag '<?' or the long tag '<?php' ?
Post by: NathanKP on October 18, 2007, 12:36:51 PM
Okay, thanks!

NathanKP
Title: Re: The short tag '<?' or the long tag '<?php' ?
Post by: mindphp on November 08, 2007, 02:18:09 PM
Quote from: akabugeyes on October 18, 2007, 11:41:52 AM
I would definitely recommend using <?php. I've never had problems with it, but I will tell you I have had problems using the <? tag before.
if you use <?
php.ini --->short_opentag=On
Title: Re: The short tag '<?' or the long tag '<?php' ?
Post by: vBulletin on October 29, 2008, 07:37:42 AM
Quote from: mindphp on November 08, 2007, 02:18:09 PM
if you use <?
php.ini --->short_opentag=On

Thank you, mindphp. :)
Title: Re: The short tag '<?' or the long tag '<?php' ?
Post by: A12 on November 24, 2008, 01:24:33 AM
I only ever use <?php for compatibility reasons, as not every server has short tags enabled(a.k.a what mindphp said lol...).
Title: Re: The short tag '<?' or the long tag '<?php' ?
Post by: mindphp on November 25, 2008, 02:17:37 PM
I mean config of php
Title: Re: The short tag '<?' or the long tag '<?php' ?
Post by: MF30 on August 25, 2009, 05:06:20 PM
Quote from: akabugeyes on October 18, 2007, 11:41:52 AM
I would definitely recommend using <?php. I've never had problems with it, but I will tell you I have had problems using the <? tag before.

Ty. :P