Re: working with files
| From: | Chris Lee | Date: | Tue, 09 Oct 2001 15:50:06 +0000 |
| Subject: | Re: working with files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70501@lists.php.net to get a copy of this message | ||
$file = fopen($file_name, 'r');
$data = fread($file, filesize($file));
$data = str_replace('visitor', 'something else', $data);
$file = fopen($file_name, 'w');
fwrite($file, $data);
--
Chris Lee
lee@mediawaveonline.com
"Alawi Albaity" <phpcf@yahoo.com> wrote in message
news:20011007141602.18411.qmail@web20205.mail.yahoo.com...
> I have file and name it file.txt
>
> the file data is
>
> ----
> hello ho are vistor
> i love the vistor that visit my site
>
> ---
>
>
> now i want to change a word in my data
> this word is :
> vistor
>
> how can i do this ??
>
> __________________________________________________
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site hosting, just
$8.95/month.
> http://geocities.yahoo.com/ps/info1