1) They keys can be integers or unicode strings (ordering works differently for these two cases)
2) The keys are not necessarily ordered (see ksort and krsort functions, for example).
$arr = array(); $arr[0] = 'cat'; $arr[2] = 'dog'; $arr[1] = 'fish'; krsort($arr); var_dump($arr);
array(3) { [2]=> string(3) "dog" [1]=> string(4) "fish" [0]=> string(3) "cat" }
1) They keys can be integers or unicode strings (ordering works differently for these two cases)
2) The keys are not necessarily ordered (see ksort and krsort functions, for example).