{?php $a = "ad b c d"; $aa = split(' ', $a); foreach ($aa as $k => $v) { if ($v == '') { unset($aa[$k]); } } print_r($aa); ?}