By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,222 Members | 1,436 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,222 IT Pros & Developers. It's quick & easy.

using output buffering

P: n/a
hi folks,

this piece of code should not display anything:

ob_start();
print_r($users);
ob_end_clean;
well, for me it does - does anyone know why? in fact, it looks like the
ob_xxx() commands are simply ignored except for ob_get_contents() which
works fine.

output_buffering is off in php.ini, but that should not make a
difference if I have understood the manual correctly.

I am using PHP 4.3.8 on a debian box w/ apache 1.3.33-3 running PHP as a
module.

thanks in advance...

martin
--
For email contact please mail to:
mail (at) mbant dot de
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Martin Braun wrote:
hi folks,

this piece of code should not display anything:

ob_start();
print_r($users);
ob_end_clean;

well, for me it does - does anyone know why? in fact, it looks like
the ob_xxx() commands are simply ignored except for ob_get_contents()
which works fine.


Don't forget the parentheses to make it a function call:
ob_end_clean();

Add those and it will work fine.

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Jul 17 '05 #2

P: n/a
.oO(Martin Braun)
this piece of code should not display anything:

ob_start();
print_r($users);
ob_end_clean;

well, for me it does - does anyone know why?


Yep. You should set error_reporting to E_ALL in your php.ini ...

Micha
Jul 17 '05 #3

P: n/a
Chris Hope wrote:
Don't forget the parentheses to make it a function call:
ob_end_clean();


er... yep, you're right! sorry for wasting your time :)

g
mb

--
For email contact please mail to:
mail (at) mbant dot de
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.