A slight adaptaion from before ...
// $large_string already defined
$final_arrays = array();
$large_array = explode("<br>", $large_string);
foreach($large_array as $line){
$final_arrays[] = explode(" ", $line);
}
Now you have an array of arrays.
To get the original back ...
foreach($final_arrays as $inner_array){
$inner_strings[] = join(" ", $inner_array);
}
$new_large_string = join("<br>", $inner_strings);
There might be a quicker (more efficient) way to do this, but here, at least you can see what's going on.