array_filter

Syntax:array array_filter ( array $input [, callable $callback = "" ] ) Description:Filters elements of an array using a callback function
<?php
$entry = array(
             0 => 'foo',
             1 => false,
             2 => -1,
             3 => null,
             4 => ''
          );
print_r(array_filter($entry));
?>
OUTPUT
Array ( [0] => foo [2] => -1 )