Take a look at some of the ob_ functions in the php manual
http://nz.php.net/manual/en/function.ob-get-contents.php


Philip Arndt wrote:
> Hi,
>
> I'm just wondering if anybody knows of a way to run a function that  
> contains print statements in a mode that will instead "print" to a  
> buffer that I can use inside another function?
>
> e.g.
>
> function do_something()
> {
>       print "{success: true}";
> }
>
> but run this like so:
>
> function do_something_else
> {
>       $result = print_to_variable(do_something);
>
>       print $result . ", {returntype: string}";
> }
>
> Probably a bit of a leftfield request, but that sort of thing is what  
> I'm after.
>
> Cheers,
> Phil
>
> >   
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com 
> Version: 8.0.169 / Virus Database: 270.7.1/1687 - Release Date: 9/23/2008 
> 6:32 PM
>
>   

--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to