| Start | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Basic usage getting content between buffers and clearing Output buffering allows you to store any textual content (Text, Any content outputted between Calling |
||||||||||||||||||
| Nested output buffers You can nest output buffers and fetch the level for them to provide different content using the Outputs: |
||||||||||||||||||
Running output buffer before any content In this example we assume If there are no results, we redirect to an error page. We are using the output buffer here because we are triggering a |
||||||||||||||||||
| Processing the buffer via a callback You can apply any kind of additional processing to the output by passing a callable to Output: |
||||||||||||||||||
Using Output buffer to store contents in a file, useful for reports, invoices etc This example takes the complete document, and writes it to file, it does not output the document into the browser, but do by using |
||||||||||||||||||
Stream output to client |
||||||||||||||||||
| Capturing the output buffer to re-use later In this example, we have an array containing some data. We capture the output buffer in Save the above code in a file You should see the 2 list items we created above with the same list items we generated in PHP using the output buffer: |
||||||||||||||||||
| Typical usage and reasons for using ob_start
The error that will be given is something like: |
Read Article
https://develop.horje.com/learn/1434/reference