Forum Moderators: coopster
[edited by: jatar_k at 8:42 pm (utc) on Jun 8, 2010]
[edit reason] examplified [/edit]
function myreplace($find, $replace, $src){
$src = str_replace($find, $replace, $src);
return $str;
}
if ($handle = opendir('/path/to/files')) {
while (false !== ($file = readdir($handle))) {
$contents = file_get_contents("/path/to/files/$file");
$contents = myreplace("replace@email.com", "me@mail.com", $contents);
$h = fopen("/path/to/files/$file", "w");
fwrite($h, $contents);
fclose($h);
}
closedir($handle);
}
?>