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

From: Date: Thu, 22 Aug 2002 12:58:55 +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-15441@lists.php.net to get a copy of this message
http://www.php.net/manual/en/function.array-key-exists.php The manual is a wonderous thing... ;) Ross PS It may interest you to know, placing an @ sign at the start of functions or declarations ignores any errors you might get > -----Original Message----- > From: R.S. Herhuth [mailto:ronherhuth@pop.mindspring.com] > Sent: 22 August 2002 13:47 > To: php-windows@lists.php.net > Subject: [PHP-WIN] finding out if a key exists in an associative array > > > > > I'm creating an associative array that creates keys and values for those > keys on the fly. Later I need to check and see if the array contains a > key before I call it to avoid the dreaded "Undefined Index" error. Is > it possible to see if a key exists in an associative array before I call > it? Kind of like the "isset" to check if a variable exists before you > call it, and it doesn't error out on you. > > Thanks, > Ron > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

« previous php.windows (#15441) next »