Forum Moderators: coopster

Message Too Old, No Replies

Passing stored output amongst multiple functions

         

dougmcc1

12:07 am on Feb 14, 2008 (gmt 0)

10+ Year Member



I have about 6 functions that currently use "echo" to output data.

I want to add the data to a text file so that users can download the file. But I cant figure out how to get each individual function to add data to the same file as the script runs.

Do I need to create a new text file for each function or is there a way for all of them to keep appending to the same text file until the script finishes so that users dont have to download multiple files?

Thanks.

jatar_k

12:55 am on Feb 14, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



when you open/create the text file you create a file handle

you can reuse this handle throughout the script to continue to write to the same file, then just close it at the end of the script.