It can be done easily with a good combination of sed and xargs.
find . -name "*.php" | xargs -n 1 echo will show you the power of xargs.
After that, on a sample file, you can test the regexp, with an inplace change (-i) or a backup change (-i.bak). You can also use an other character to replace '/' if your pattern/replacement already have one.
At the end, it should looks like :
pattern=`cat /path/to/pattern`; replacement=`cat /path/to/replacement` find . -name "*.php" | xargs -n 1 sed -i -e "s|$(cat /path/to/pattern)|$(cat /path/to/replacement)|g""s|$pattern|$replacement|g"