Re: About printing functions

From: Date: Wed, 21 Jan 2009 19:38:15 +0000
Subject: Re: About printing functions
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-286936@lists.php.net to get a copy of this message
On Wed, Jan 21, 2009 at 08:49:46PM +0200, Thodoris wrote: <snip> > > Well Jason my point is theoretical. Lets just say that this function > doesn't just print "blah blah blah" but like tones of html that you may > like to reuse... > > Well you could always change it to this: > > function print_str() { > $str = "blah blah blah"; > return $str; > } > > and use the output you got from the function whenever you like (print > it, make it a toast, cook it with bees etc). > > But the question still remains: Is there a way to do this? The only way to save this text off is to put it in a $_SESSION variable or cookie, at least if you want to save it beyond the present page. Oh, you could also store it in a database. Paul -- Paul M. Foster

« previous php.general (#286936) next »