Let me see if I understand you correctly. You want to take an array like this:
array("a","b"," ","c","d"," ")
and you want to turn it into this:
array("a","b","c","d")?
Try this: Loop through the array, check if the value is " ", and use unset() to unset it.
If that fails, just write each one to a new array, and then erase the old one.