I've been staring at this for 6+ hours. Can someone explain this to me?
print_r(array_values($listingziparray));
will result in.....
Array (
[0] => Array ( [ID] => 358 [zipTwo] => 20781 [distance] => 1.3 )
[1] => Array ( [ID] => 294 [zipTwo] => 20002 [distance] => 4.1 )
[2] => Array ( [ID] => 59 [zipTwo] => 20008 [distance] => 7.1 )
[3] => Array ( [ID] => 396 [zipTwo] => 20910 [distance] => 7.2 )
[4] => Array ( [ID] => 288 [zipTwo] => 20015 [distance] => 7.4 )
[5] => Array ( [ID] => 226 [zipTwo] => 22209 [distance] => 8.6 )
[6] => Array ( [ID] => 218 [zipTwo] => 20016 [distance] => 8.9 ) )
The very next line...
echo "<script>alert('listingziparray[5]=" . $listingziparray[5]['ID'] . "')</script>";
gives me a popup with the value "218",
which really should correspond with the $listingziparray[6]['ID'] value.
Now the very next line...
echo "<script>alert('listingziparray[6]=" . $listingziparray[6]['ID'] . "')</script>";
gives me a popup with a blank value.
So, I'm really stumped. I know the array has 7 elements or values, because of the above call to array_values. And, if I popup the value resulting from...
$numOfListings = count($listingziparray);
it returns a 7.
What has happened that I can't access all of the array?
Thanks!