废话不多说,直接用array_filter()方法就完事了,下面是demo
<?php $array = array('a' => "哈哈哈", 'b' => "呵呵",'c' =>"",'d' =>"嘻嘻",'e'=>""); $arr= array_filter($array); print_r($arr); ?>