I have been coding FOREACH($ARRAY AS $KEY=>$VAL) for years.
Now with php 5, I find that this iterates through both the numeric subscripts and the associated names. I am confused. Did this change in php 5 or have I lost all my grey cells?
When I iterate an assoc array now I get eg:
5 = five
number = five
6 = foo
fie = foo
7 = fred
name = fred
etc
... so I end up filtering, eg:
foreach($vid AS $fldName => $fldValue)
{
if ( is_int($fldName) )
{
//skip
}
else
{
process($fldName,$fldValue);
}
}
Thank you in advance for kind assistance.