I wrote a script to clean all files in all directories and sub directories. I recommend you backup 1st. This is done from inside the shell
1st create a file called fixmacro in your home directory and add the following 2 lines to it
:1/ua=strtolower/s/^.*<?php$/<?php/
:wq
Next from the directory where the infected files are or you can run it from your home directory run the following command.
find . -name *.php -exec vi -s ~/fixmacro {} \;
This will go to every php look for the infected lines and remove them. If these are no infected files it resaves the file with no changes/