天天看点

php问题……php如何去除空数组

<?php
$entry = array(

             0 => 'foo',

             1 => false,

             2 => -1,

             3 => null,

             4 => ''

          );

 

print_r(array_filter($entry));

?>

Array

(

    [0] => foo

    [2] => -1

)