尝试这个:
$cond = array('condition' => array(0 => 1, 1 => 2, 2 =>3),
'container' => 'Test',
'status_clean' => 'Yes',
'owner' => 'Yes',
'last_cargo' => 9,
'vessel' => 'Saja',
'insulation' => 2,
'tare' => 'Yup',
'gross' => 'Test',
'capacity' => 'Saja',
'date_of_manu' => 'Yeah',
'name_manu' => 'Clip',
'last25' => 'Converter',
'cert25' => 'Yeah',
'last5' => 'Saja',
'cert5' => '',
'list3_item_0' => 2,
'list3_kondisi_0' => 'OK',
'comments' => 'Test Comments');
// first get the `condition`'s value
$condition_arr = array_shift($cond);
echo "
";
print_r($condition_arr); // condition values
print_r($cond); // all without condition
echo "
";?>输出。第一个数组是condition,第二个数组是数组的其余部分:
Array
(
[0] => 1
[1] => 2
[2] => 3
)
Array
(
[container] => Test
[status_clean] => Yes
[owner] => Yes
[last_cargo] => 9
[vessel] => Saja
[insulation] => 2
[tare] => Yup
[gross] => Test
[capacity] => Saja
[date_of_manu] => Yeah
[name_manu] => Clip
[last25] => Converter
[cert25] => Yeah
[last5] => Saja
[cert5] =>
[list3_item_0] => 2
[list3_kondisi_0] => OK
[comments] => Test Comments
)