POV-Ray : Newsgroups : povray.off-topic : Lamp me one : Re: Lamp me one Server Time
11 Oct 2024 03:14:51 EDT (-0400)
  Re: Lamp me one  
From: Nicolas Alvarez
Date: 5 Feb 2008 12:06:15
Message: <47a89787$1@news.povray.org>
Warp escribió:
> Gilles Tran <gitran_nospam_@wanadoo.fr> wrote:
>> The trick is to build long text strings in PHP (that include the HTML tags 
>> and everything you want to see on screen) and then echo the result.
> 
>   Even if some library or whatever just echoes/prints everything it
> produces (instead of returning a string), there's a way to redirect
> that printing to a string. (I don't remember now the exact command
> for that, though.)
> 

ob_start();
function_that_prints_stuff();
$string = ob_get_clean();

ob_get_clean is like getting the string with ob_get_contents, and then 
throwing away the buffer with ob_end_clean. There is a dozen functions 
for output buffering, so be sure to rtfm :)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.