Re: key_exists from php

From: Date: Mon, 30 Apr 2001 01:52:24 +0000
Subject: Re: key_exists from php
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-53008@lists.php.net to get a copy of this message
At 09:50 PM 4/29/01 -0400, David Croft wrote:
There doesn't seem to be any way for a php script to determine whether a given key exists in an array. isset($arr['x']) fails when it exists but has a null value. I know there are ways around it like using foreach or array_keys but these don't seem very efficient. I would like to add a function key_exists, with the following proto: bool key_exists(array search, string key) Please let me know if this is inappropriate or I have missed something obvious, otherwise I shall add this tomorrow. Thanks,
Key may be a number as well. -Andrei

« previous php.dev (#53008) next »