Pee-H-Pee
09-24-2004, 10:13 PM
I am generating a text file with one line per record. But I need to also include a header and footer to add information to the bottom and top of the generated text file.
This is what I have so far:
$line = "STUFF PULLED FROM THE DATABASE";
//Generate the text file here
$fp = fopen("file.txt", 'a');
chmod("file.txt", 0777);
fwrite($fp, $line);
fclose($fp);
So I need the file.txt to show:
HEADER INFO HERE
Database Stuff Here generated by the above PHP code
FOOTER INFO HERE
Hope that made sense :D
This is what I have so far:
$line = "STUFF PULLED FROM THE DATABASE";
//Generate the text file here
$fp = fopen("file.txt", 'a');
chmod("file.txt", 0777);
fwrite($fp, $line);
fclose($fp);
So I need the file.txt to show:
HEADER INFO HERE
Database Stuff Here generated by the above PHP code
FOOTER INFO HERE
Hope that made sense :D