there might be a better way, but this is what u can use
function remove_blocks($input){
$array_input = explode(" ",$input);
// print_r($array_input);
$count = 0;
$array_output = array();
foreach($array_input as $key=>$value){
if($array_input[$key]!=""){
$array_output[$count] = $value;
$array_output[$count+1] = "";
}
$count = $count+2;
}
// print_r($array_output);
$output = implode(" ",$array_output);
return trim($output);
}
//testing
$b = remove_blocks("aa bb cc dd ee");
echo $b;
reg
kevin