how can I add a variable to this sample

From: Date: Thu, 03 Jan 2002 23:16:16 +0000
Subject: how can I add a variable to this sample
Groups: php.general 
Request: Send a blank email to php-general+get-79387@lists.php.net to get a copy of this message
I have a large form that I would like to edit a number of records. I'm putting all of the fields into one array and then I would like to pull the fields independently from a loop. Here's part of the loop foreach ($z as $key => $value) { $service_type_insert = $x['$keyservice_type']; What I'm looking for is for the $key variable to be replaced with the record id, which is what $key is. So the second line should look like; $service_type_insert = $x['629service_type']; I've tried a number of variations, i.e.; $service_type_insert = $x[$keyservice_type]; $service_type_insert = $x['\$keyservice_type']; $service_type_insert = $x["$keyservice_type"]; Is there a way that I can format it correctly? Thanks, Tom

« previous php.general (#79387) next »