PHP完全自学手册(珍藏版) 中文pdf扫描版下载
- <?php
- $array = array (0 =>
- array (
- 'id' => '20110209172713',
- 'Date' => '2011-02-09',
- 'Weight' => '200',
- ),
- 1 =>
- array (
- 'id' => '20110209172747',
- 'Date' => '2011-02-09',
- 'Weight' => '180',
- ),
- 2 =>
- array (
- 'id' => '20110209172827',
- 'Date' => '2011-02-09',
- 'Weight' => '175',
- ),
- 3 =>
- array (
- 'id' => '20110211204433',
- 'Date' => '2011-02-11',
- 'Weight' => '195',
- ),
- );
- $numbers = array_map(function($details) {
- return $details['Weight'];
- }, $array);
- $min = min($numbers);
- $max = max($numbers);
- echo $min."</br>";
- echo $max;
转载请注明:谷谷点程序 » php找出数组中最大值和最小值