array_filter

$entry = array( 
             0 => '蓝色夏威夷的博客', 
             1 => false, 
             2 => 1, 
             3 => null, 
             4 => '', 
             5 => 'http://www.jb51.net', 
             6 => '0',
             7 => array(),
             8 => 0
          );
$validarr = array_filter($entry);
print_r($validarr);
//输出结果:
Array
(
    [0] => 蓝色夏威夷的博客
    [2] => 1
    [5] => http://www.jb51.net
)

你可能感兴趣的:(php1200,I)