Home > Backend Development > PHP Tutorial > 这样的数组怎么降序输出

这样的数组怎么降序输出

WBOY
Release: 2016-06-13 13:29:49
Original
1291 people have browsed it

这样的数组如何降序输出?
$arr=array(array('132','20120524','23232.2','21.31'),array('126','20120524','-231232.2','13.321'),array('321','20120524','232.32','1.31')));

根据第3小组数据进行降序输出,请老师指教,谢谢!

------解决方案--------------------

PHP code
foreach($arr as $v) $t[]=$v[2];
array_multisort($t,SORT_DESC,$arr);
print_r($arr); <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template