3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $input = 'id_order:2,id_account:1'; $chunks = array_chunk(preg_split('/(:|,)/', $input), 2); $result = array_combine(array_column($chunks, 0), array_column($chunks, 1)); print_r($result);
based on DTXAF
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
Array ( [id_order] => 2 [id_account] => 1 )