include()ing into a variable

From: Date: Thu, 14 Oct 2004 17:35:15 +0000
Subject: include()ing into a variable
Groups: php.general 
Request: Send a blank email to php-general+get-199504@lists.php.net to get a copy of this message
Hi, I have never done this before (but in my first test it seems to work), I am include()ing a file into a variable like this: $a=include("th-file.php"); Will this give me any extra problems later on? or is this resource intensive? The reason I am doing this is because I want to put whole pages into a variable then write the contents of the variable to a static html file... eg: $a=include("header.php"); $a .= "<all the results from my database queries and calcalutions etc here>"; $a .= include "footer.php"; ->fopen and write $a to newfile: something.html Thats the idea anyway.... this is the first time I am experimenting with this approach, so I want to know is this "legal" in php and if I should be expecting any problems. The final pages to output can be around 100k I guess and I will be outputting every 3-60 mins. Thanks, Mag ===== ------ - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) _______________________________ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com

« previous php.general (#199504) next »