This is from the PHP manual under comments:
If you have a line with multiple seperator symbols between elements, for example " ", like this one:
$line = "192.168.68.60 0x1 0x2 00:E0:1E:7F:D5:26 * eth1"
to get rid of null values while exploding you can do something like this:
$line = preg_replace("/\s+/", " ", $line);
$elements = explode(" ", $out);
Here you replace 1 or more whitespace characters (\s+) with single whitespace character " " (a seperator in this case), and then just explode the whole stuff.
Then you'd take it like so....
$pizza = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
Check out the Explode function, anyway.