CrazyStyle
New Member
If you have an associative array:\[code\]Array( [uid] => Marvelous [status] => 1 [set_later] => Array ( [0] => 1 [1] => 0 ) [op] => Submit [submit] => Submit)\[/code\]And you want to access the 2nd item, how would you do it? \[code\]$arr[1]\[/code\] doesn't seem to be working:\[code\]foreach ($form_state['values']['set_later'] as $fieldKey => $setLater) { if (! $setLater) { $valueForAll = $form_state['values'][$fieldKey]; $_SESSION[SET_NOW_KEY][array_search($valueForAll, $form_state['values'])] = $valueForAll; // this isn't getting the value properly }}\[/code\]This code is supposed to produce:\[code\]$_SESSION[SET_NOW_KEY]['status'] = 1\[/code\]But it just produces a blank entry.