Is this the proper way to do it?
$temp and $file is assigned one file each (eg. myFile.tmp and myFile.txt).PHP Code:
$fh = fopen($temp, "w");
$content = @file($file) or die ("Error...");
foreach ($content as $line_num => $line) {
if (!(preg_match("/\b$mailTo_User\b/i", $line))) {
fwrite($fh, "$line\n");
}
}
copy($temp, $file);
fclose($fh);
unlink($temp);
The script should delete the b@blip.com, but not ab@blip.com.
I think it is working, is it?
/Marcus


Reply With Quote
Bookmarks