I want to open a text file which has 12 lines and (1) insert a new line at line[0] (2) re-save the text file only with 12 lines (Therefore line[12] 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[0] <-------?? and rewrite the file. (http://www.php.net/manual/en/function.fopen.php) John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php