- var_export: documentation ( source)
- explode: documentation ( source)
<?php
$array = [
'x' => 'Laura Smith',
'y' => 'John. Smith',
'z' => 'John Doe'
];
foreach ($array as $key => $value) {
[$array[$key]] = explode(' ', $value, 2);
}
var_export($array);