I have a directory containing lots of PHP scripts with unwanted trailing characters.
The scripts should end with ?> and NOT with newlines or ÿ.
So if ANY .php file contains ANYTHING after the last ?> that is NOT 0-9 or a-Z then I want EVERYTHING after the last ?> to be REMOVED.
How can I do this for all scripts in a directory and its sub-directories (recursively)? Keep in mind that some PHP scripts contain several <? and ?> and I only want to check for the very last ?>