array_filter();
$myarray = array_filter($myarray, 'strlen'); //removes null values but leaves "0" $myarray = array_filter($myarray); //removes all null values
array_filter