DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Replace Old Style PHP Tags To New Style Tags

05.17.2006
| 7040 views |
  • submit to reddit
        Sometimes you have to work with scripts that contain old-style PHP tags. This little snippets fixes those scripts, so they use the new style PHP tags.

find * -type f -exec perl -i -wpe 's/<\?php/<\?/g' {} \;
find * -type f -exec perl -i -wpe 's/<\?/<\?php/g' {} \;