Take a look at following functions:
On Wed, 5 Jun 2002, John Taylor-Johnston wrote:
> I want to open a text file which has 12 lines and
> (1) insert a new line at line
> (2) re-save the text file only with 12 lines (Therefore line gets
> chopped out.
> I had some code to do this with Perl.
> open (NEW, ">$filepath\\$file");
> print NEW "$something";
> for ($i = 2; $i < 12; $i++)
> print NEW "$lines[$i]";
> print "$lines[$i]";
> How can I do it now with PHP?
> Open the file (http://www.php.net/manual/en/function.fopen.php)
> Suck a text file into an array. <-------??
> Insert at line <-------??
> and rewrite the file.
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php