473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

using output buffering

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
3 1212
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
.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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mark Evenson | last post by:
A question about Output Buffering in PHP-CLI. Is it expected that the following code will emit two representations of $x? I would like to use print_r(), but capature its output in a String, to...
4
by: Leslie Houk | last post by:
I'm just learning PHP, and I'm having a problem using fpassthru(). I want to download a file using the following code segment I found, which I put into my testing file called portal.php: ...
2
by: vishal | last post by:
hi vishal here. can anyone tell me that how to buffer output and then send the output to client at a time. what is my problem is that i have a php file which runs query on database and takes...
1
by: Tim Mohler | last post by:
All - I have a script that provides a web page interface to various system utilities. Once the user has selected the utility and input various parameters, it calls itself with a different method...
1
by: Shahid Juma | last post by:
Hi, I was wondering if something similar to php (ob_get_contents(), output buffering) exists in ASP/VBscript. Thanks Shahid
14
by: dawnerd | last post by:
Hi, I am developing a CMS and came across something which has never happened to me before, and I re-wrote the specific script twice, both differently, and still had the same error. I'm not sure...
2
by: Thormod Johansen | last post by:
Hi, I am doing some embedded programming in Paradigm C++, and I would like to be able to output debugging information using the << operator and ostreams. I have a serial link for which I have...
4
by: Grant Edwards | last post by:
When I ssh in to my Windows XP box and run Python apps, output from "print" and and "sys.stdout.write()" is being buffered so that none of the output shows up until the program exits. From...
11
by: JRough | last post by:
I'm trying to use output buffering to cheat so i can print to excel which is called later than this header(). header("Content-type: application/xmsdownload"); header("Content-Disposition:...
0
by: JRough | last post by:
On Sep 26, 3:23 pm, Captain Paralytic <paul_laut...@yahoo.comwrote: without the exit I get this again: Warning: Cannot modify header information - headers already sent by (output started at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.