Re: write on the begin of a file
| From: | Marek Kilimajer | Date: | Wed, 30 Oct 2002 12:28:37 +0000 |
| Subject: | Re: write on the begin of a file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122011@lists.php.net to get a copy of this message | ||
There is no insert in fputs, you need to make a new file and then rename it to
your old one, or build it in the memory and then overwrite it.
Sébastien Eckert -- Netika wrote:
Hi I have this *********** line 1 line 2 ... *********** and i want have this after my script ... *********** MY NEW TEXT line 1 line 2 ... *********** i had test this but it seems not work : $fp = fopen("test", "a+"); fseek ($fp,0); fputs($fp,"set IP=192.11.11.11\n"); fclose($fp); i had test the same script with w+ and rewind($fp) but it didnt work ... thx .....