Posted by Arjen on 06/12/06 14:42
laredotornado@zipmail.com schreef:
> Hello,
>
> I have a text file. I would like to write a line of data as the first
> line and then another as the last line. What is the easiest way to do
> this using php 4?
>
> Thanks, - Dave
>
$oldtext = file_get_contents("a.txt");
$firstline = "";
$lastline = "";
$newtext = $firstline.$oldtext.$lastline;
And the save the text in the file
take a look at
http://php.net/manual/nl/function.fopen.php
Arjen
[Back to original message]
|