3v4l.org

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