3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = '224,1,23,Pineapple,2500,2500,anana.png__240,1,23,Goavy,2500,250, goavy.png__140,1,23,Apple, 100,250,pomme.png'; $arr = explode("__", $str); Foreach($arr as $val){ $items = explode(",", $val); $res[$items[4]] = $items[3]; } print_r($res);
based on WY7b7
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.3.0rc3
Array ( [2500] => Goavy [ 100] => Apple )