RE: [PHP] Re: Getting an include file into a string after PHP evaluates the vars?

From: Date: Wed, 30 Jan 2002 17:36:58 +0000
Subject: RE: [PHP] Re: Getting an include file into a string after PHP evaluates the vars?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-82766@lists.php.net to get a copy of this message
ob_get_contents() appears to be exactly what I needed. Thanks for putting me on the right track! :) -- Kevin Stone Kevin@helpelf.com www.helpelf.com > -----Original Message----- > From: CC Zona [mailto:email@cczona.com] > Sent: Tuesday, January 29, 2002 6:49 PM > To: php-general@lists.php.net > Subject: [PHP] Re: Getting an include file into a string after PHP > evaluates the vars? > > In article <007601c1a91f$ea9ecac0$6401a8c0@kevin>, > kevin@helpelf.com (Kevin Stone) wrote: > > > I don't know why I didn't think of this ahead of time but in order to > > produce the HTML-based ePostcard email I have to get the evaluated > > template into a string. > > > > I can fopen() the template file and read it into a string but the PHP > > won't evaluate. And since most of the template is HTML with some > > Javascript of course eval() won't work on the string. > > > > Did I paint myself into a corner here? Or is there a way out that I > > just don't see. > > You could use output buffering. Start a buffer, include template(s), > manipulate buffer content, end/flush the buffer. > <http://www.php.net/manual/en/ref.outcontrol.php> > > -- > CC > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#82766) next »