3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = "39X3,29X5"; $out = array(); foreach(explode(",", $data) as $item) { $out[] = array_combine(['number', 'prize'], explode('X',$item)); } print_r($out);
based on riL2p
Output for 5.6.38 - 7.3.0
Array ( [0] => Array ( [number] => 39 [prize] => 3 ) [1] => Array ( [number] => 29 [prize] => 5 ) )