fetch_all_by_available_required(1, 1) as $field) { $choices = array(); if($field['selective']) { foreach(explode("\n", $field['choices']) as $item) { list($index, $choice) = explode('=', $item); $choices[trim($index)] = trim($choice); } $field['choices'] = $choices; } else { unset($field['choices']); } $data['field_'.$field['fieldid']] = $field; } savecache('fields_required', $data); } ?>