$arr1 = array_column($data, 'RateRiseFall');
$news = array_multisort($arr1, SORT_DESC ,SORT_NUMERIC , $data);
print_r($data);
降序
<pre>Array
(
[0] => Array
(
[stockCode] => 000001
[stockName] => 平安银行
[nowPrice] => 10.37
[RateRiseFall] => 2.57%
)
[1] => Array
(
[stockCode] => 000002
[stockName] => 万科A
[nowPrice] => 21.01
[RateRiseFall] => -2.14%
)
[2] => Array
(
[stockCode] => 002164
[stockName] => 宁波东力
[nowPrice] => 2.75
[RateRiseFall] => -3.17%
)
[3] => Array
(
[stockCode] => 000006
[stockName] => 深振业A
[nowPrice] => 4.67
[RateRiseFall] => -3.51%
)
[4] => Array
(
[stockCode] => 600532
[stockName] => 宏达矿业
[nowPrice] => 4.38
[RateRiseFall] => -10.06%
)
)
<pre>
升序::
$arr1 = array_column($data, 'RateRiseFall');
//p($arr1);
array_multisort($arr1 ,SORT_NUMERIC , $data);
<pre>Array
(
[0] => Array
(
[stockCode] => 600532
[stockName] => 宏达矿业
[nowPrice] => 4.38
[RateRiseFall] => -10.06%
)
[1] => Array
(
[stockCode] => 000006
[stockName] => 深振业A
[nowPrice] => 4.67
[RateRiseFall] => -3.51%
)
[2] => Array
(
[stockCode] => 002164
[stockName] => 宁波东力
[nowPrice] => 2.75
[RateRiseFall] => -3.17%
)
[3] => Array
(
[stockCode] => 000002
[stockName] => 万科A
[nowPrice] => 21.01
[RateRiseFall] => -2.14%
)
[4] => Array
(
[stockCode] => 000001
[stockName] => 平安银行
[nowPrice] => 10.37
[RateRiseFall] => 2.57%
)
)