Skip navigation

<?php

	ob_start();	# use the output buffer

	echo('hello there! i am data echod into the output buffer');

	$data = ob_get_contents();
	# variable $data now contains the string 'hello there! i am data echod into the output buffer'
	ob_end_clean(); # basically just turn off output buffering and clean it out

# alternatively, use ob_get_clean() to get buffer contents and clean it immediately afterward with a single function call!

?>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: