天天看點

php問題……php如何去除空數組

<?php
$entry = array(

             0 => 'foo',

             1 => false,

             2 => -1,

             3 => null,

             4 => ''

          );

 

print_r(array_filter($entry));

?>

Array

(

    [0] => foo

    [2] => -1

)