<?php//返回奇数 function test_odd($var) { return($var & 1); } $a1=array("a","b",2,3,4); print_r(array_filter($a1,"test_odd")); ?>
数组去空
$arr=array_filter($arr)