explode() into $key=>$value pair

Don’t believe this is possible in a single operation, but this should do the trick:

list($k, $v) = explode(' ', $strVal);
$result[ $k ] = $v;

Leave a Comment