Name: joba Date: May 3, 2007 at 06:48:22 Pacific Subject: Checking values in an array OS: win vista premium CPU/Ram: intel 2 gb ram Model/Manufacturer: hp
Comment:
Can a check on the value gender in an array be checked like this?
if (!isset(array['gender']) //do so and so } else { //do so and so };
First, you shuld always specify what language you are using - it could have been confused for Javascript.
Second you need to give an example of the array values. In your example you are testing to see if the array KEY 'gender' in the array has been set, it does nothing to determine the value of that array index.
Laler's example tests to see if the VALUE 'gender' exists for any of the keys within the array.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE