Page 1 of 1

accesing array elements

Posted: Thu Aug 26, 2004 7:17 am
by pelegk2
i have an array like this :

Code: Select all

<?php
Array(
    [006] => Array
        (
            [0] => 146
            [1] => 1
        )

    [016] => Array
        (
            [0] => 157
            [1] => 1
        )

    [018] => Array
        (
            [0] => 150
            [1] => 1
        )

    [019] => Array
        (
            [0] => 158
            [1] => 1
        )

)
?>
why can i access an element like this :
myArr[006] ???

Posted: Thu Aug 26, 2004 9:40 am
by feyd
why can you? because that array element exists.. IIRC, a leading zero will tell the core you want an octal number.. so you may want to turn those into strings.