Re: write to specific place in file
| From: | Bas Jobsen | Date: | Fri, 15 Mar 2002 18:42:15 +0000 |
| Subject: | Re: write to specific place in file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-88690@lists.php.net to get a copy of this message | ||
First read it, then split and then write it.
$fp=fopen($file,"r");
$content=fread($fp,filesize($file));
fclose($file);
$parts=explode($splitsign,$content);
$fp=fopen($file,"w");
fwrite($fp,$parts[0].$insert.$splitsign.$parts[1]);
fclose($file);
Op vrijdag 15 maart 2002 19:09, schreef John P. Donaldson:
> How do I write to a specific place in a file instead
> of just using fputs to append text to the end of the
> file?
>
> Thanks,
> John
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - live college hoops coverage
> http://sports.yahoo.com/