|
|
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
|
|