On Wed, 25 Aug 2004 14:04:51 +0100, Geoff Caplan <[EMAIL PROTECTED]> wrote:
> I think you are probably right - but this behaviour causes problems.
> For example:
>
> $foo['one']['two'] = "test-string" ;
>
> // Evaluates to TRUE (not what's wanted!)
> isset( $foo['one']['two']['three'] ) ;
>
> I need a reliable way to test for the non-existence of a
> multi-dimensional key. Any ideas? I guess I could convert the keys
> into a string via a loop and compare that, but there must be a more
> elegant way, surely?
>
> ------------------
> Geoff Caplan
>
How about array_key_exists?
array_key_exists('three', $foo['one']['two']);
http://jp2.php.net/manual/en/function.array-key-exists.php
----
ramil
http://ramil.sagum.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php