This is a clever nearly one-liner that should do the job:
$result = array_map(function($line) {
return preg_split('/\s+/', $line);
}, explode("\n", $text));
First explode()
the $text
to separate lines, then preg_split()
it by spaces.
2
solved How to split this text into columns