$bob = "Roy";
$s = 'Hey there $bob';
$s = 'print "'. $s .'";';
eval ($s);

prints: "Hey there Roy";

perhaps that's what you're looking for?


> -----Original Message-----
> From: John Vanderbeck [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 4:21 PM
> To: King, Justin; [EMAIL PROTECTED]
> Subject: RE: [PHP] Variable question
> 
> 
> How about manually parsing the string out to give you chunks, that can then
> be eval'd easy.
> 
> - John Vanderbeck
> - Admin, GameDesign (http://gamedesign.incagold.com/)
> - GameDesign, the industry source for game design and development issues
> 
> 
> > -----Original Message-----
> > From: King, Justin [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, May 07, 2001 4:18 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: [PHP] Variable question
> >
> >
> > A simple eval($mysqldata) isn't going to do it though since the string
> > is "Your username is $userdata["username"]"; it'll just spit a parse
> > error.  I've already tried that
> >
> > -Justin
> >
> > -----Original Message-----
> > From: "Jack Dempsey" <[EMAIL PROTECTED]>
> > Sent: Monday, May 07, 2001 1:13 PM
> > To: King, Justin; [EMAIL PROTECTED]
> > Subject: RE: [PHP] Variable question
> >
> > ok, look into eval()
> >
> > -----Original Message-----
> > From: King, Justin [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, May 07, 2001 4:07 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: [PHP] Variable question
> >
> >
> > Here let me flesh this out a bit more
> >
> > Consider the query "SELECT datafield FROM myTable WHERE id=1";
> >
> > This would return "My username is $userdata["username"]";
> >
> > I want to then output what the database returns, and have php evaluate
> > my variables.
> >
> > -Justin
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to