Re: key_exists from php

From: Date: Mon, 30 Apr 2001 15:41:06 +0000
Subject: Re: key_exists from php
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-53090@lists.php.net to get a copy of this message
On Sun, Apr 29, 2001 at 09:50:13PM -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. Wouldn't empty() handle that case? e.g. if (!empty($arr['x'])) echo $arr['x']; -- Jon Parise (jon@csh.rit.edu) . Rochester Inst. of Technology http://www.csh.rit.edu/~jon/ : Computer Science House Member

« previous php.dev (#53090) next »