Organizational Research By

Surprising Reserch Topic

Question:how to remove all null values from the array in php ?



asked Sep 13, 2013 in PHP by rajesh
edited Sep 12, 2013
+1 vote
70 views



Related Hot Questions

2 Answers

0 votes

 

  function array_filter_recursive($input, $callback = null) 
  { 
    foreach ($input as &$value) 
    { 
      if (is_array($value)) 
      { 
        $value = array_filter_recursive($value, $callback); 
      } 
    } 
    
    return array_filter($input, $callback); 
  } 
?>
answered Sep 13, 2013 by rajesh
edited Sep 12, 2013
0 votes

 

  function array_filter_recursive($input) 
  { 
    foreach ($input as &$value) 
    { 
      if (is_array($value)) 
      { 
        $value = array_filter_recursive($value); 
      } 
    } 
    
    return array_filter($input); 
  } 
?> 
answered Sep 13, 2013 by rajesh
edited Sep 12, 2013

...