Tag Archive: replace


In PHPStorm, you can do a regex find and replace. To upgrade a crappy old site using <?, just use the following regex:

#<\?(?!=|php|xml)#

https://regex101.com/r/yD6dK5/5

Advertisements

Now that my VM is completely configured through puPHPet’s puphpet/files/exec-once shell scripts, I had to change PHP settings for the legacy 5.3 install. At first I echoed the setting out and concatenated it onto the end of the string, however the setting was already uncommented above.

The answer is to use sed to find and replace the line of text, like this!

cat /etc/php.ini | sed -e "s/short_open_tag = Off/short_open_tag = On/" >> /etc/php.ini