ob_start is a PHP function which turns output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer.
Questions tagged [ob-start]
190 questions
2
votes
3 answers
HTML miss interpreted by browsers: Header-Content appears in Body - Why?
There is my source:
As you can see the source is correct, but Firefox reports an error.
Now look at the console of Firefox:
There is a miss interpretation: The original content between the header tags (css, scripts) you can find in the body.
Same…

user1711384
- 343
- 1
- 7
- 24
2
votes
2 answers
Equivalent funcion of PHP "ob" functions in Python/Django
Is there any function do the same result like PHP ob_start(myCallbackFunction) and ob_end_flush() that allow me modify the layouts and views in Python frameworks (Django/others)? thanks!
UPDATE
user2678106
2
votes
1 answer
Remove repeating code in CodeIgniter functions
We are using CodeIgniter to wrap some internal functions and to display the results in json.
Occasionally our internal functions might have debug strings printed to the screen. So we have started using output buffering to capture any debug and add…

Gareth Foster
- 39
- 3
2
votes
4 answers
ob_get_clean, only works twice
Take this simple script:
ob_start();
$text = array();
echo 'first text';
$text[] = ob_get_clean();
echo 'second text';
$text[] = ob_get_clean();
echo 'third text';
$text[] = ob_get_clean();
echo 'fourth text';
$text[] =…

Drahcir
- 11,772
- 24
- 86
- 128
2
votes
1 answer
Code for attaching an image created from data to an e-mail and sending works in the test.php file but not in my main object function. What is wrong?
My php file gets passed image/png data and needs to attach it to an e-mail and send said e-mail.
Here is working code from a test file:

Bil1
- 440
- 2
- 18
2
votes
1 answer
ob_start Caching CSS
I'm using this php code to cache css files into a middle own CMS.

Danilo
- 2,016
- 4
- 24
- 49
2
votes
3 answers
php curl memory usage
I have this function that gets the html from a list of pages and once I run it for
two hours or so the script interrupts and shows that memory limit has been exceeded,
Now i've tried to unset/set to null some variables hopefully to free up some…

inrob
- 4,969
- 11
- 38
- 51
2
votes
2 answers
PHP output buffering (ob_start, ob_flush)
I used php output buffering earlier in order to create csv file from database, because i didn't want to create an existing file, just wanted to make content downloadable.
CSV is text-based file, so its easy to create this way, you set the header and…

Iburidu
- 450
- 2
- 5
- 15
2
votes
4 answers
How to redirect with header location in php when using ob_start?
Hello " if ($condition) { header( "Location: http://www.google.com/" ); exit; } echo " World!