RE: [PHP] Variables within a string

From: Date: Mon, 11 Mar 2002 03:10:45 +0000
Subject: RE: [PHP] Variables within a string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-87948@lists.php.net to get a copy of this message
I would imagine the problem has something to do with those escaped quote marks, but in any case, you could probably get around it by doing this: $foo = "Entry for " . $HTTP_POST_VARS["name"]; some correct me if I'm wrong -chris > -----Original Message----- > From: webapprentice [mailto:webapprentice@onemain.com] > Sent: Sunday, March 10, 2002 10:09 PM > To: php-general@lists.php.net > Subject: [PHP] Variables within a string > > Hello, > > When I try to do this: > $foo = "Entry for for $HTTP_POST_VARS[\"name\"]"; > > I receive this error: > Parse error: parse error, expecting T_STRING' or > T_VARIABLE' or > `T_NUM_STRING' on line X > > Why does it do this, and how do I get around this, besides assigning the > value of $HTTP_POST_VARS[\"name\"] to variable $bar? > > Thank you for your time and help. > > --Stephen > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#87948) next »