Use the array_filter () function in php to remove multi-dimensional null code sharing. In fact, we can use the array_filter function to easily remove multi-dimensional null values without changing the subscript of the array. The following is an example :? Php $ arrayarray (0 brother, 1 false, 21,3 in fact, we can use the array_filter function to easily remove multi-dimensional null values, while the subscript of the array has not changed. The following is an example:
$ Array = array (
0 => 'Your go ',
1 => false,
2 => 1,
3 => null,
4 => '',
5 => 'http: // www.jb51.net ',
6 => '0'
);
Print_r (array_filter ($ array ));
?>
The output result of the above code is:
Array
(
[0] =>
[2] => 1
Http://www.jb51.net
)
In this way, the null, null, or false values are excluded to avoid program vulnerabilities!
Why :? Php $ array = array (0 = 'hangzhou', 1 = false, 2 = 1, 3...