php.nub Posted May 29, 2007 Share Posted May 29, 2007 Hi, I've been a PHP 5 programmer for a while now... and am self taught. I'm trying to convert a PHP 4 script to PHP 5... but have come across a short tag which i'm not quite sure how to re-write in PHP 5 - with short tags disabled. The PHP 4 short tag is: <?= Now I want to convert that to PHP 5... I assumed that the correct way to do that in PHP 5 would be to do the following: <?php echo But that only seems to do what was intended for some of the functions of the PHP script... e.g. it doesn't seem to work for: <?=iif($_type=="today", $_SUPP["language"]["dashtoday"], $_SUPP["language"]["dashnewstitle"])?> I would much appreciate it if someone would enlighten me as to what the correct php 5 tag would be - with short tags disabled. Many Thanks, ~php.nub Quote Link to comment https://forums.phpfreaks.com/topic/53389-solved-php-4-to-5-short-tagsyntax-question/ Share on other sites More sharing options...
MadTechie Posted May 29, 2007 Share Posted May 29, 2007 iif is probably your own function use <?php echo ($_type=="today")?$_SUPP["language"]["dashtoday"]:$_SUPP["language"]["dashnewstitle"]; ?> Quote Link to comment https://forums.phpfreaks.com/topic/53389-solved-php-4-to-5-short-tagsyntax-question/#findComment-263801 Share on other sites More sharing options...
php.nub Posted May 29, 2007 Author Share Posted May 29, 2007 Cheers, i'll try that. Just 200 odd files to go though again now Quote Link to comment https://forums.phpfreaks.com/topic/53389-solved-php-4-to-5-short-tagsyntax-question/#findComment-263802 Share on other sites More sharing options...
php.nub Posted May 29, 2007 Author Share Posted May 29, 2007 Turned out to be PHP in an XML file... Cheers, for the suggestion though! Quote Link to comment https://forums.phpfreaks.com/topic/53389-solved-php-4-to-5-short-tagsyntax-question/#findComment-263858 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.