0
我拿來一個陣列從一個表PHP數組操縱鍵
arr1 = Array
(
[0] => Array
(
[option_value_id] => 30
[duration_id] => 1
[price_value] => 13
)
[1] => Array
(
[option_value_id] => 30
[duration_id] => 2
[price_value] => 14
)
[2] => Array
(
[option_value_id] => 30
[duration_id] =>3
[price_value] =>15
)
[4] => Array
(
[option_value_id] => 31
[duration_id] => 1
[price_value] => 16
)
[5] => Array
(
[option_value_id] => 31
[duration_id] => 2
[price_value] => 17
)
[6] => Array
(
[option_value_id] => 31
[duration_id] =>3
[price_value] => 18
)
我需要duration_id關鍵和option_value_id爲重點的duration_id陣列中 我得到的數組應該是這樣的
Array
(
[1] => Array
(
[30] => 13
[31] => 16
)
[2] => Array
(
[30] => 14
[31] => 17
)
[3] => Array
(
[30] => 15
[31] => 18
)
)
?>
打我吧!工作很好。 – 2011-01-13 05:25:55