On Tue, 14 Sep 2004 22:32:54 +0200, -{ Rene Brehmer }-
<[EMAIL PROTECTED]> wrote:
> Unless I misunderstand how PHP make unspecified arrays (and I probably do
> since this works), when you have an array of 3 elements on the first
> dimenstion like I do, and then ask for $arrlevels[$lvl_guest]['levelname'],
> which in this case actually means it asks for $arrlevels[99]['levelname']
> .... how come it pick the correct element, and not error out that element
> 99 don't exist ??
> 
> My only conclusion (based on the fact that this actually works) is that PHP
> makes the key the same as the value if the key isn't specified. But is this
> actually correct ???? Or is there something "going on" that I don't know
> about ???

Yes, that is what's happening, a simple test shows this:

#!/usr/bin/php
<?php
$a = array(1, 2, 3);
print_r($a);
?>

output:
Array
(
    [0] => 1
    [1] => 2
    [2] => 3
)


-- 
Greg Donald
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to