3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $configOptions = array( '1:'=>'1l:', '2:'=>'2l:', '3:'=>'3l:', '4:'=>'4l:', '5:'=>'5l:', '6:'=>'6l:', '7:'=>'7l:', '8:'=>'8l:', '9:'=>'9l:', '10:'=>'10l:', '11:'=>'11l:', '12:'=>'12l:', '13:'=>'13l:', '14:'=>'14l:' ); $out = str_replace(':', '', $configOptions); foreach($out as $key=>$value){ $newKey = str_replace(':', '', $key); $newOut[$newKey] = $value; } var_dump($newOut);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(14) { [1]=> string(2) "1l" [2]=> string(2) "2l" [3]=> string(2) "3l" [4]=> string(2) "4l" [5]=> string(2) "5l" [6]=> string(2) "6l" [7]=> string(2) "7l" [8]=> string(2) "8l" [9]=> string(2) "9l" [10]=> string(3) "10l" [11]=> string(3) "11l" [12]=> string(3) "12l" [13]=> string(3) "13l" [14]=> string(3) "14l" }