That'd be my guess as well - and it's possibly not that left-field. I
find the ob_start() stuff to be fairly crucial when working with the
likes of Wordpress - where everything is thrown at the screen as soon as
it springs to mind (as it were).
The apps I write don't do this... they accumulate the whole page as a
string, then output (or write it to a cache or whatever) it at the end.
> ob_start();
> echo "Hello";
> $buffer = ob_get_clean();
>
>
> 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
>>
>
> >
>
> Internal Virus Database is out of date.
> Checked by AVG - http://www.avg.com
> Version: 8.0.138 / Virus Database: 270.7.0/1682 - Release Date: 9/20/2008
> 10:24 AM
>
>
>
--
______________________________________________________________________
NICK TAYLOR :: [EMAIL PROTECTED]
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
www.ikostar.com :: stuff
www.twitter.com/ikostar :: twitter
www.tangerineworks.com :: web dev
www.11v11.com :: football
www.weirdsky.com :: T-shirts for alpha geeks
phone :: (0064) 6 343 2425
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---