samona Posted January 20, 2010 Share Posted January 20, 2010 what is <?= Quote Link to comment Share on other sites More sharing options...
schilly Posted January 20, 2010 Share Posted January 20, 2010 I can't remember what it is exactly called in the php.ini file but basically <?= is the same as <?php echo The option has to be turned on if you php.ini file to be able to use it. ex. <?=$varable?> is much shorter than doing <?php echo $variable; ?> Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 20, 2010 Share Posted January 20, 2010 <? ?> and <?= ?> are called short tags. These can only be used if the setting called short_open_tag is enabled. However it is not recommended to use these tags as not all PHP configurations have this setting enabled. You're better of of using the full PHP tag syntax <?php ?> and <?php echo ?> Quote Link to comment Share on other sites More sharing options...
gizmola Posted January 20, 2010 Share Posted January 20, 2010 Although I don't disagree with wildteen88 in terms of the basic consensus, I don't seem much of a problem with using short tags, if you can control the server environment. Sometimes these issues have a way of being pushed by the people who write projects used by the masses, when there is more people writing php for sites or businesses where there is no concern about control of the php.ini file, or being able to enable short tags. Up until version 5.3 the default was to have short tags set to on. I don't have a problem with short tags, especially when used in templates. For example, there's no doubt that template writers will prefer: = $pageheader ?> Rather than the tedium of Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.