1 2 3 4 5 6 7
<?php $array = array("This", " ", "is", " ", "a", " ", "test."); $array = preg_grep('/^\s*\z/', $array, PREG_GREP_INVERT); var_dump($array);
1 2 3 4 5 6 7 8 9 10
array(4) { [0]=> string(4) "This" [2]=> string(2) "is" [4]=> string(1) "a" [6]=> string(5) "test." }