A script like this may have already been done but I thought to give it a shot. It may have a few bugs but it did work to a point. The only thing that i noticed is that it does not edit but copies and moves the files to the directory of the script. All it is search and replace files in a directory. Noting big but may be of some use.
A note if you do use this it is advised that you back up the directory you are going to edit.
<?php
$dirtoedit="edit";
$dir=dir($dirtoedit);
$i=1;
while (($file = $dir->read()) !== false)
{
if ($file!='.' && $file!='..' && $file!='.htaccess')
{
$search="echo";
$page=file_get_contents("$dirtoedit/$file");
if(strstr($page,$search)){
$new=str_replace($search,"print",$page);
$f=fopen($file,"w");
//chmod may not be needed not sure
chmod($file,0644);
fwrite($f,$new);
fclose($f);
echo"<h3>$i: $file edited</h3>";
$i++;
}
}
}
$dir->close();
?>