Something anamolous in php: finding the highest index of an array is non-trivial.
There should be some method available that tells what the highest index of an
array is. In the first example it should be two, in the second example it
should be 12.
All arrays in PHP are, by definition, hashes. As such the concept of first and
last elements is essentially meaningless. count(), and its alias sizeof(), returns the
number of current elements, not the last element.
$A[] = "aa"; $A[] = "bb"; $A[] = "cc";
$A["abc"] = "abc"; $A["xyz"] = "xyz";
$A[10] = "10";
foreach ($A as $Key=>$Value) {
echo "<BR>$Key=$Value\n";
}
lists the elements in the order in which they were entered. Any assignment
in the form of $A[] will use the next highest numeric index, ignoring any gaps
in values. $A[] = "new"; would use index 11 in the above example.
Urb