I want to share this great php utility: the output buffering, it is sometimes very usefull. So what it does ?
The PHP output buffering will save all the server outputs ( html and php prints) to a string variable.
So to start buffering, use ob_start(); this will keep saved any output.
Then you use $variable = ob_get_clean(); to stop buffering, and copy the buffer content to the variable.
Here are few samples of the use of ob_start() and ob_get_clean()
Now the content of the variable $var should be:
Another example (with php outputs buffered)
And this will be the content of $var:
That's all !
Links to visit !
- String Capitalization Functions: strtoupper-strtol...
- PHP For Loop
- PHP Validate Email Address: Email Validator
- PHP Random code Generator
- PHP Get browser Language
- PHP $_REQUEST
- PHP send mail SMTP authentification
- ob_start - save php output to a string - The PHP o...
- PHP send HTML email, The complete php mail sending...
- PHP mail() - send email with php
- ▼ January (10)