Newbie question: I'm using fwrite to output PHP results to a text file. This is working fine, but fwrite only takes a string as an argument. I want to stick some big blocks of HTML code in my output. I usually use include for this, but in order to pass to fwrite, I need to include a file and have its contents become a variable. In other words, something like:
include "filename.txt";
$fp = fopen ("outfile.html", "aw");
fwrite($fp, "$header");
fwrite($fp, "some text");
fclose ($fp);
Obviously that won't work, but it would work if the contents of the include could be assigned to $header. But how?
Thanks for a clue.