Leading zeros in array index
| From: | Kent Briggs | Date: | Fri, 19 Apr 2002 21:43:29 +0000 |
| Subject: | Leading zeros in array index | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-93759@lists.php.net to get a copy of this message | ||
My first post here, sorry if this has been covered before:
Why does including a leading zero in an array index cause
problems? For example, the output of this script:
----------------
$x =
array("a","b","c","d","e","f","g","h","i","j");
echo $x[0];
echo $x[1];
echo $x[2];
echo $x[3];
echo $x[4];
echo $x[5];
echo $x[6];
echo $x[7];
echo $x[8];
echo $x[9];
echo "<br>";
echo $x[00];
echo $x[01];
echo $x[02];
echo $x[03];
echo $x[04];
echo $x[05];
echo $x[06];
echo $x[07];
echo $x[08];
echo $x[09];
-----------------
returns this result:
abcdefghij
abcdefghaa
The [08] and [09] values are messed up but [00] thru [07] are
ok.
--
Kent Briggs, kbriggs@briggsoft.com
Briggs Softworks, http://www.briggsoft.com