I use $errors to track any form errors.
But because there mabye any number of rows displayed in the form, $errors is coded as follows:
$errors['fnamee'][$i]="test of error"; //an example
$errors['lnamee'][$i]="test of error"; //an exmaple
(where $i starts at 1 and is incremented for each row)
and can result in an array looking like this:
[fnamee] => Array
(
[1] => test of error
[2] => test of error
...etc.
)
[lnamee] => Array
(
[1] => test of error
[2] => test of error
...etc.
)
What I would like to do, and can't figure out how to do it using count, is determine when $errros['anykey'][$i] is not empty. Again where $i equals an integer of the row I am processing at the time.
Answering this, will save me from checking each $errors key for that row to see if there is an error. I know if is probably easy, but I still getting a handle on arrays.
For example now I do something like this to check for errors for a row of data:
IF !(empty($errors['fnamee'][$i])) || !(empty($errors['lnamee'][$i]))) do or not do something...as you can see..if there are alot of fields in a row...well you know...
Thanks in advance...