希望我能正確解釋這一點。PHP如何組合多維數組,其值相同
我有一個多維數組得到這個數組結果:
Array
(
[0] => Array
(
[subscription_plan_id] => 36
[transactionID] => WU3E5YRHHKMKMM3ZLLSJMNUWJM
[property_id] => 1026
[plan_name] => One Month
[plan_month] => 1
[start_date] => 2015-02-10 14:58:32
[end_date] => 2015-03-10
[active] => 1
[parent_id] => 27
)
[1] => Array
(
[subscription_plan_id] => 17
[transactionID] => WU3E5YRHHKMKMM3ZLLSJMNUWJM
[property_id] => 1026
[plan_name] => 1 Realistic Photo
[plan_month] => 1
[start_date] => 2015-02-10 14:58:32
[end_date] => 2015-03-10
[active] => 1
[parent_id] => 16
)
[2] => Array
(
[subscription_plan_id] => 15
[transactionID] => WU3E5YRHHKMKMM3ZLLSJMNUWJM
[property_id] => 1026
[plan_name] => Six months - at least twenty-four golden lists
[plan_month] => 6
[start_date] => 2015-02-10 14:58:32
[end_date] => 2015-08-10
[active] => 1
[parent_id] => 12
)
[3] => Array
(
[subscription_plan_id] => 9
[transactionID] => WU3E5YRHHKMKMM3ZLLSJMNUWJM
[property_id] => 1025
[plan_name] => One month
[plan_month] => 1
[start_date] => 2015-02-10 14:58:32
[end_date] => 2015-03-10
[active] => 1
[parent_id] => 5
)
[4] => Array
(
[subscription_plan_id] => 3
[transactionID] => WU3E5YRHHKMKMM3ZLLSJMNUWJM
[property_id] => 1025
[plan_name] => Three months
[plan_month] => 3
[start_date] => 2015-02-10 14:58:32
[end_date] => 2015-05-10
[active] => 1
[parent_id] => 1
)
)
,我想按property_id
鍵:
Array
(
[0] => Array
(
[0] => Array
(
[subscription_plan_id] => 36
[transactionID] => WU3E5YRHHKMKMM3ZLLSJMNUWJM
[property_id] => 1026
[plan_name] => One Month
[plan_month] => 1
[start_date] => 2015-02-10 14:58:32
[end_date] => 2015-03-10
[active] => 1
[parent_id] => 27
)
[1] => Array
(
[subscription_plan_id] => 17
[transactionID] => WU3E5YRHHKMKMM3ZLLSJMNUWJM
[property_id] => 1026
[plan_name] => 1 Realistic Photo
[plan_month] => 1
[start_date] => 2015-02-10 14:58:32
[end_date] => 2015-03-10
[active] => 1
[parent_id] => 16
)
[2] => Array
(
[subscription_plan_id] => 15
[transactionID] => WU3E5YRHHKMKMM3ZLLSJMNUWJM
[property_id] => 1026
[plan_name] => Six months - at least twenty-four golden lists
[plan_month] => 6
[start_date] => 2015-02-10 14:58:32
[end_date] => 2015-08-10
[active] => 1
[parent_id] => 12
)
[1] => Array
(
[0] => Array
(
[subscription_plan_id] => 9
[transactionID] => WU3E5YRHHKMKMM3ZLLSJMNUWJM
[property_id] => 1025
[plan_name] => One month
[plan_month] => 1
[start_date] => 2015-02-10 14:58:32
[end_date] => 2015-03-10
[active] => 1
[parent_id] => 5
)
[1] => Array
(
[subscription_plan_id] => 3
[transactionID] => WU3E5YRHHKMKMM3ZLLSJMNUWJM
[property_id] => 1025
[plan_name] => Three months
[plan_month] => 3
[start_date] => 2015-02-10 14:58:32
[end_date] => 2015-05-10
[active] => 1
[parent_id] => 1
)
)
)
任何想法?這個怎麼做。
感謝
[Group am通過特定的值ultidimensional數組?](http://stackoverflow.com/questions/2189626/group-a-multidimensional-array-by-a-particular-value) – 2015-02-10 10:59:14