Re: Re-engineering print()

From: Date: Thu, 11 Jan 2001 06:37:00 +0000
Subject: Re: Re-engineering print()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-33912@lists.php.net to get a copy of this message
On Wed, 10 Jan 2001, Kristofer Widholm wrote: > Basically, I'm wondering if there is a way to redirect print and echo > output from PHP to a variable instead of directly to a browser or > file stream. What I'm trying to do is create code that can generate > an HTML page to a variable that I can manipulate and then later store > in a database. http://www.php.net/manual/ref.outcontrol.php Specifically, ob_get_contents(). Start an output buffer, include your files, get the contents, and ob_ed_clean. Ought to do the trick. Matt

« previous php.general (#33912) next »