php数组元素去空,测试奇数偶数时间:2023-03-09 19:14:25 <?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)