Read over some of the examples at:
http://us4.php.net/types.array

If you don't set a key, PHP starts with '0' and increments as you add
more elements to the array.

If you have "NOTICEs" turned on, I believe you'll get a notice saying
that $arrlevels[99] doesn't exist.  It's not a fatal error, so PHP just
passes over it and doesn't say anything unless you tell it to.

# One dimensional array
$arrlevels = array(1,2,3);

# Three dimensional array.  $lvl_guest is a key and 'levelname' is a key
$arrlevels[$lvl_guest]['levelname'];

-TG

> 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 ???

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

Reply via email to