$s = system ("/usr/local/whatever/php/bin/php /path/to/your/file.php");

This should be what you're after. In PHP4 there _may_ be some way
to use the inbuilt buffering for that purpouse, but I doubt it.

Perhaps this could be added to the language? It would be a good
counterpart to eval()...

Gfunk

       My name was Brian McGee,
       I stayed up listening to Queen,
       When I was seventeen.

http://www.gfunk007.com/


----- Original Message ----- 
From: "Kristofer Widholm" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 5:19 PM
Subject: Re: [PHP] Re-engineering print()


> Here's what you wrote, 01-01-11:
> 
> >  > $s = sprintf("%s", implode("\n", file('template.php')));
> >
> >Why this??? It's redundant, isn't it? Wouldn't
> >
> >$s= implode("\n", file('template.php')); do it?
> >
> >Gfunk
> 
> Gfunk, and Mr. Murray,
> 
> I guess I didn't write my query very clearly. What I am looking for 
> is not just storing the PHP in a variable (that, as you both have 
> pointed out, is easy enough), but I want to EXECUTE the PHP script 
> (including it's print statements and everything) and instead of 
> having that output go directly to the browser, I want it to go to the 
> variable. The solutions offered certainly do put the PHP into a 
> variable, but it doesn't execute the PHP and have the output of the 
> executed PHP get stored into the variable.
> 
> Thanks for familiarizing me with implode(), though, as I'm sure to 
> use that often.
> 
> Sincerely,
> Kristofer
> -- 
>                               http://www.brokenhill.net
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/~~~~~~~~~~~~~~~~~~~~~~~~
> "The only real ideas are the ideas of the shipwrecked"
> --Ortega y Gassett
> 
> ~~~~~~~~~~~~~~~~~~~/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to