2), array("id"=>1), array("id"=>5), array("id"=>7), array("id"=>33),);如何找到"/> 2), array("id"=>1), array("id"=>5), array("id"=>7), array("id"=>33),);如何找到">

Home  >  Article  >  Backend Development  >  求数组中最小的id,该如何处理

求数组中最小的id,该如何处理

WBOY
WBOYOriginal
2016-06-13 10:11:321009browse

求数组中最小的id
$arr1=array(
array("id"=>2),
array("id"=>1),
array("id"=>5),
array("id"=>7),
array("id"=>33),
);

如何找到最小的id的值

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

PHP code
foreach($arr1 as $v){   $arr[]=$v['id'];}echo min($arr);<div class="clear">
                 
              
              
        
            </div>
Statement:
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