Try:
find . -name "*.php" -exec sed -i "s/$pattern$(cat /$replacementpath/to/pattern.txt)/$(cat /path/to/replacement.txt)/g" {} \; where pattern is the pattern to search for and replacement is the text to replace it with.
The -i option for sed edits the files "in place". If you want to create a backup of the file before you edit it, use -i'.bak'.