Hello,
Now i have a file,and its content is such as the following few lines
"
how are you?
hello
"
how to i change the line of "hello" to "fine" and then write to a file?
I use the following code
$file=fopen("passwd.txt","r+");
while (!feof($file))
{$string=fgets($file,80);
if (eregi("hello",$string))
{$string= ereg_replace("hello","fine",$string);
fwrite($file, $string);}
}
fclose($file);
however,the output becomes
"
how are you?
hello
fine
"
Thanks for all suggestion!