$word = "web";
$filename = "e:/datefile.txt";
$contents = file_get_contents($filename);
echo $contents . "<br />";
// str_ireplace() - Case-insensitive version of str_replace()
$contents = str_ireplace($word, "net", $contents, $count);
if($count > 0)
{
file_put_contents($filename, $contents);
echo $contents . "<br />";
}
else
{
echo "not found";
}
/*
run:
PHP For Web Applications Is Popular On The Web
PHP For net Applications Is Popular On The net
*/