Re: About printing functions
| From: | Török Alpár | Date: | Thu, 22 Jan 2009 12:25:14 +0000 |
| Subject: | Re: About printing functions | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-286996@lists.php.net to get a copy of this message | ||
2009/1/22 Jan G.B. <ro0ot.w00t@googlemail.com>
> 2009/1/21 Thodoris <tgol@kinetix.gr>:
> >> <?php
> >> ob_start();
> >> badFunctionThatSpitsInsteadOfReturning();
> >> $sReturned = ob_get_contents();
> >> ob_end_clean();
> >> ?>
> >
> > That's a good though thanks. Although I was aware of output buffering I
> used
> > to ignore that ob_end_clean actually exists...
> You can even make it shorter by using
> ob_start(); echo 1;
> $retVar = ob_get_clean();
>
> http://de.php.net/ob_get_clean()
> <http://de.php.net/ob_get_clean%28%29>
>
Yes, but that leaves output buffering on, and that's a bad thing, especially
if you are on the console, but anyhow, why leave it on when you don't need
it, or even if you do, why create more levels?
>
>
> Byebye
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Torok, Alpar Istvan