Hi all. I've got a very strange thing happening with a simple array in a page I'm building.
Take the following code:
<?php
$samplearray = array("item 1" => 01,
"item 2" => 02,
"item 3" => 03,
"item 4" => 04,
"item 5" => 05,
"item 6" => 06,
"item 7" => 07,
"item 8" => 08,
"item 9" => 09,
"item 10" => 10,
"item 11" => 11,
"item 12" => 12);
while (list($key,$val) = each($samplearray)) {
echo "$key = $val<br>";
}
?>
The results of this are as follows:
item 1 = 1
item 2 = 2
item 3 = 3
item 4 = 4
item 5 = 5
item 6 = 6
item 7 = 7
item 8 = 0
item 9 = 0
item 10 = 10
item 11 = 11
item 12 = 12
Can anyone explain why item 8 and item 9 have the value 0, when they've clearly been assigned the values 08 and 09, respectively?
Thanks in advance.
Pablo