I got some help, this is what we came up with!
<?php
$string = "This is a test string for parsing";
$exp_str = explode(" ", $string);
for($i=0;$i<=count($exp_str);$i++) {
if($exp_str[$i] != "") {
$string_parsed .= " ".$exp_str[$i];
}
}
echo $string_parsed;
?>