Re: Eval()??? A variables contents?

From: Date: Fri, 09 Nov 2001 20:06:51 +0000
Subject: Re: Eval()??? A variables contents?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-74050@lists.php.net to get a copy of this message
I just asked a similar question yesterday. The answer is, conveniently enough, eval(). One trick from the php.net page on the function is to do somehting like this: $content = "<?PHP Query_Database( $category );?>"; echo eval ("?>$content"); Christopher Raymond wrote: > > PHP Gurus: > > I have one for you. I'm sure there is a simple solution, but I'm having > difficulty finding it. > > Let's say I have: > > $content = "<?PHP Query_Database( $category );?>"; > > If I use <?PHP echo $content; ?>, it doesn't evaluate that content. What am > I doing wrong here? > > Is there an equivalent to JavaScript's eval($commands) function? > > TIA, > > Christopher Raymond > > -- > 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 -- Chris Hobbs Silver Valley Unified School District Head geek: Technology Services Coordinator webmaster: http://www.silvervalley.k12.ca.us/~chobbs/ postmaster: chobbs@silvervalley.k12.ca.us

« previous php.general (#74050) next »