Re: [PHP] Assigning output of include() to a variable

2001-09-16 Thread Sid
Hey I did it. A special thanks goes out to Michael Kimsal for giving me the idea of output buffering. Here is the code I used. Hope this helps ob_start(); // Start output bufering include ("$filename"); //$filename is the file you want to include $x = ob_get_contents(); //Set the contents of the

Re: [PHP] Assigning output of include() to a variable

2001-09-09 Thread askwar
Zitiere Sid <[EMAIL PROTECTED]>: > For anyone who did not understand me --> Instead of the stupid include() > > function outputing the file contents to the browser I need it to assign Well, don't code so stupidly then... Instead of you stupidly echo'ing each and everything directly, better as

Re: [PHP] Assigning output of include() to a variable

2001-09-09 Thread Michael Kimsal
file() probably won't do it, unless you call an http:// file request to your webserver - PHP won't execute other PHP code in another file when pulled in thru file(). What you are looking for is most likely output buffering. Read up on ob_start at php.net/ob_start. Basically turn output bufferin

Re: [PHP] Assigning output of include() to a variable

2001-09-09 Thread Jason Brooke
> Hi, > > I've been trying to figure this thing out for 3 hours now. Lets say we have > a variable $x. Now I need to assign $x with similar output that comes from > an include function. > > For anyone who did not understand me --> Instead of the stupid include() > function outputing the file conte