$arr=array(2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020);$count=0;foreach ($arr as $key=>$value){ //循环遍历if($value%4==0 && $value%100!=0 || $value%400==0){ //条件$count++; //因要统计闰年的个数,所以++echo $value; //输出数组的值echo \"<br>\";}}echo $count; //输出闰年的个数