phpshorttags

How do i convert php short tag to full one


I am to edit a project of another guy who used php short tag everywhere in his script. I have short tag disabled in my server. I think converting all the short tags instead of enabling short tag in my server is the better one.

So which way to go better:

  1. Converting All short tag?

  2. Enabling short tag in my server?

  3. How do i convert all short tag to full one in batch


Solution

  • Converting can be written using http://php.net/manual/en/function.token-get-all.php . Unlike find&replace, this does not affect XML declarations and so on. Converting vs. enabling ST: It depends. Many programmers probably prefers <?php to <?, so when you convert, you code will be more "standard". However, the importancy https://meta.stackoverflow.com/of "standard"-way depends on the situation.