PHP array keys: 0, 1, '1', 'true' und 'false' als key

<?php

$myArray[ 0 ] = 1;

$myArray[ 1 ] = 2;

$myArray[ '1' ] = 3;

$myArray[ true ] = 4;

$myArray[ false ] = 5;

print_r( $myArray );

?>

Das Ergebnis sieht so aus:

Array ( [0] => 5 [1] => 4 )

 

Warum 1,2,3 sind verschwunden?

 

 

Neuen Kommentar schreiben

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Suche

Neueste Kommentare