3v4l.org

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