anujgarg Posted October 20, 2009 Share Posted October 20, 2009 Hi Everyone, I am working on a site that is built up on PHP4 and each page is being started from <? instead of <?php as of PHP5. I want to convert this <? to <?php on every page so that I can render the page properly in the browser. I am using WAMP Server 2.0 and it is creating problem to display the page in the browser if <? is there in the php file. Please suggest... TIA Anuj Link to comment https://forums.phpfreaks.com/topic/178305-php4-to-php5-conversion/ Share on other sites More sharing options...
PugJr Posted October 20, 2009 Share Posted October 20, 2009 I'm quite sure that you can set which way you want it in your php.ini. Link to comment https://forums.phpfreaks.com/topic/178305-php4-to-php5-conversion/#findComment-940205 Share on other sites More sharing options...
anujgarg Posted October 20, 2009 Author Share Posted October 20, 2009 PugJr, I believe it is "short_open_tag" that needs to be turned On. By default it is Off in php.ini for PHP5. Please let me know if I am wrong. Link to comment https://forums.phpfreaks.com/topic/178305-php4-to-php5-conversion/#findComment-940206 Share on other sites More sharing options...
PFMaBiSmAd Posted October 20, 2009 Share Posted October 20, 2009 Most programming editors have a search/replace feature that would allow you to find and replace the occurrences of <? and <?= with <?php and <?php echo And the <? vs <?php has nothing to do with php version, but with a second shorter tag that unfortunately can be turned off (what were they thinking) and there is no guarantee that you will always be on a server where you will have the ability to turn it on. It is much better to spend the few minutes correcting your code once, than fighting something every time you switch to a different server or someone makes a change to your server configuration. Link to comment https://forums.phpfreaks.com/topic/178305-php4-to-php5-conversion/#findComment-940209 Share on other sites More sharing options...
trq Posted October 20, 2009 Share Posted October 20, 2009 That is indeed the correct setting however your still better off switching your tags. Most good text editors have string replace functionality, and most IDE's will replace over an entire project. Of course you could also use a combintaion of find and sed if your on Linux and get stuck. Link to comment https://forums.phpfreaks.com/topic/178305-php4-to-php5-conversion/#findComment-940211 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.