Brillo Agent Nr. 1: Array-Reihenfolge nicht konsistent

Beitrag lesen

hi,

$log = array();

$log[2] = "nenn mich 2";
$log[1] = "sag eins zu mir";
$log[0] = "ich bin null";
$log[3] = "ich heiße drei";

$elements = implode("¿", $log);
echo $elements;


>   
>   
> nenn mich 2¿sag eins zu mir¿ich bin null¿ich heiße drei  
  
Warum sollte es (in PHP) anders sein?  
  
"An array in PHP is actually an ordered map. A map is a type that associates values to keys. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other arrays, trees and multidimensional arrays are also possible."  
  
Quelle: php.net