I'm trying to understand this code:
<?php
$list = array(-10=>1, 2, 3, "first_name"=>"mike", 4, 5, 10=>-2.3);
print_r(array_keys($list));
?>
Output:
Array ( [0] => -10 [1] => 0 [2] => 1 [3] => first_name [4] => 2 [5] => 3 [6] => 10 )
I'm wondering why [4] => 2 and why [5] => 3
i thought it would be [4] => 4 and [5] => 5
because they are both at index 4 and 5. I'm slightly confused as to what exactly is going on in this array, if possible could someone point me in the right direction, Thank You.