an array can be created by the array() language construct
bar
1
Une value peut etre de nimporte quel type PHP
5
9
42
Differentes sortes de declarations
$arr3 = array ( 5 => 40, 6 => 18, 7 => "b", 8 => "zut") est le meme tableau que le suivant
$arr4 = array ( 5 => 40, 18, "b", 8 => "zut")
$arr3 :
40
18
b
zut
$arr4 :
40
18
b
zut
Create a simple array.
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
)
Now delete every item, but leave the array itself intact:
Array
(
)
Append an item (note that the new key is 5, instead of 0 as you might expect).
Array
(
[5] => 6
)
Re-index:
Array
(
[0] => 6
[1] => 7
)
Checking 0:
Bad:
Good: 1
Bad:
Good: 1
Checking 1:
Bad:
Good: 2
Bad:
Good: 2