RE: [PHP-WIN] finding out if a key exists in an associative array

From: Date: Thu, 22 Aug 2002 13:01:20 +0000
Subject: RE: [PHP-WIN] finding out if a key exists in an associative array
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-15443@lists.php.net to get a copy of this message
isset won't work if the array value is set to NULL... > -----Original Message----- > From: Steel [mailto:asergey@inbox.ru] > Sent: 22 August 2002 13:58 > To: php-windows@lists.php.net > Subject: Re: [PHP-WIN] finding out if a key exists in an associative > array > > > Hi R.S., > > Thursday, August 22, 2002, 4:47:22 PM, I've read: > > RSH> it? Kind of like the "isset" to check if a variable exists > before you > RSH> call it, and it doesn't error out on you. > > I think You still can use isset ;) > ex: > if (isset($array[$key])) > { > do something; > } > > Also, if You want to suppres Warning messages, you can use: > > @isset($array[$key]) > > That's all. ;) Hope it'll help. > -- > The same, > Steel mailto:asergey@inbox.ru > http://www.none.ru > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

« previous php.windows (#15443) next »