-2
私はどのように列line_total降順の形式で配列を並べ替えることができます教えてください。その配列をline_total降順形式にしたいと思います。bcoz私は販売を下げるためにデータの上売りを表示したいと思います。だから私を助けてください。どのように私はPHPで配列を並べ替えることができます
Array
(
[totalusers] => 1
[TranReport] => Array
(
[start] => 01-01-2017
[end] => 31-12-2017
)
[webhits] => 794
[paypal] => Yes
[cash] => No
[Transactions] => Array
(
[0] => Array
(
[order_date] => 03-02-2017
[customer_name] => Mohsin khan
[payment_method] => PayPal
[product_list] => Array
(
[0] => Array
(
[product_name] => USB Cable – Iphone → 1M USB Cable - Iphone
[qty] => 1
[line_total] => 9
)
[1] => Array
(
[product_name] => USB Cable – Iphone → 2M USB Cable - Iphone
[qty] => 2
[line_total] => 24
)
)
[quantity] => 3
[order_currency] => USD
[order_total] => 48.00$
[new_total] => 48.00
)
[1] => Array
(
[order_date] => 09-01-2017
[customer_name] => Mohsin khan
[payment_method] => PayPal
[product_list] => Array
(
[0] => Array
(
[product_name] => AA USB Charger
[qty] => 1
[line_total] => 15
)
[1] => Array
(
[product_name] => Car Charger - Dual USB - Low Profile
[qty] => 1
[line_total] => 15
)
[2] => Array
(
[product_name] => Mister Hose → 20m Mister Hose
[qty] => 1
[line_total] => 20
)
)
[quantity] => 3
[order_currency] => USD
[order_total] => 50.00$
[new_total] => 50.00
)
[2] => Array
(
[order_date] => 07-01-2017
[customer_name] => Mohsin khan
[payment_method] => PayPal
[product_list] => Array
(
[0] => Array
(
[product_name] => Quick Charge V3 - Dual USB - Car Charger
[qty] => 1
[line_total] => 15
)
[1] => Array
(
[product_name] => Car Charger - Dual USB - Low Profile
[qty] => 1
[line_total] => 15
)
[2] => Array
(
[product_name] => Mister Hose → 20m Mister Hose
[qty] => 1
[line_total] => 20
)
)
[quantity] => 1
[order_currency] => USD
[order_total] => 15.00$
[new_total] => 15.00
)
)
[deliveytotal] => 0
)
に私は、これはあなたを助けると思う: http://stackoverflow.com/questions/2699086/sort-multi次元別配列 –
http://php.net/manual/en/function.array-multisort.php – Mohammad
私は販売を下げるために上位販売の意味を理解していませんが、データベースからのこの結果です?はいの場合は、代わりにSQLを使用してソートを行うことができます。 – bugscoder