array_filter_empty($arr)
过滤数组中值为空的元素。
$arr:数组
<?php include "./xiunophp/xiunophp.php"; $arr = array(0, 1, 2, 3, "", FALSE); $r = array_filter_empty($arr); print_r($r); /* 结果: array(1, 2, 3) */ ?>