$num = array( 10, 20, 30, 40); $arr = array_filter($num,function($v){return $v;}); $arr=array_filter($num,'test'); print_r($arr); function num($v) { $a = ''; $v > 15 && $a = $v; return $a; }