PHP script to replace strings in a file