There seems to be a bug (?) with the foreach and array_keys commands. It seems that array_keys utilizes the foreach command, because you can't use a foreach command and the array_keys command together.
The following code doesn't work:
foreach ($list as $key => $value) {
$fieldname = array_keys ($list, $key);
print $fieldname . " = " . $value;
}
but this does:
for ($i=0; $i<count($list); $i++) {
$fieldname = array_keys ($list, $i);
print $fieldname . " = " . $value;
}
Thought it should be noted. I guess this is sortof a bug (it doesn't seem to be documented anywhere)