3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr=array(array("img","dummies","slides","01.jpg"),array("img","dummies","slides","01.jpg"),array("img","dummies","slides","01.jpg")); print_r($arr); echo $num_arr=count($arr); for($i=0;$i<$num_arr;$i++) { $new_key="key_".$i; $arr[$new_key] = $arr[$i]; unset($arr[$i]); } print_r($arr);
Output for 4.3.0 - 7.1.0
Array ( [0] => Array ( [0] => img [1] => dummies [2] => slides [3] => 01.jpg ) [1] => Array ( [0] => img [1] => dummies [2] => slides [3] => 01.jpg ) [2] => Array ( [0] => img [1] => dummies [2] => slides [3] => 01.jpg ) ) 3Array ( [key_0] => Array ( [0] => img [1] => dummies [2] => slides [3] => 01.jpg ) [key_1] => Array ( [0] => img [1] => dummies [2] => slides [3] => 01.jpg ) [key_2] => Array ( [0] => img [1] => dummies [2] => slides [3] => 01.jpg ) )