RE: [PHP] Re: how can I add a variable to this sample

From: Date: Fri, 04 Jan 2002 00:18:45 +0000
Subject: RE: [PHP] Re: how can I add a variable to this sample
Groups: php.general 
Request: Send a blank email to php-general+get-79403@lists.php.net to get a copy of this message
>$service_type_insert = $x['${key}service_type']; //returns empty even >though I know a value is there change the single quotes to double, thusly: $service_type_insert = $x["${key}service_type"]; 'cause PHP is using the literal "${key}service_type" and not interpreting it -----Original Message----- From: Tom Beidler [mailto:tom@orbittechservices.com] Sent: Friday, January 04, 2002 11:00 AM Cc: php list Subject: [PHP] Re: how can I add a variable to this sample So far nothing seems to work which leads me to believe there's something else wrong. Here's what I've tried $service_type_insert = $x['926service_type']; //works fine when I hard code a value in and returns proper value $service_type_insert = $x[$$keyservice_type]; //returns empty even though I know a value is there $service_type_insert = $x['${key}service_type']; //returns empty even though I know a value is there $service_type_insert = eval($x['$keyservice_type']); //returns empty even though I know a value is there. I added single quotes because without it returned a parse error. -- 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 (#79403) next »