Hi, can anybody tell me how I can get the size of an array, it will be used in connection with the previous thread below - titled 'Validate This'!
Here is what I have so far...
if (empty($name)) {$missing = array('Name');}
if (empty($email)) {$missing = array('Email');}
if (empty($age)) {$missing = array('Age');}
Following the example in my previos thread...
This to my understanding would build an array with the following elements in the array 'Email' & 'Age';
But because I don't know what fields they left I can not assign a key, and thus do not know how to find out how many elements reside within the array!
Once I know how many elements are in the array I can then use something like...
while ($array_key <= $array_size) { print "Value missing for " . current($missing);}
If I am -dare I say- missing something, please correct my syntax and post it here.
Thnx,
Charlie