I'm still having problems telling (and coding the difference), though I know the associative array, indexes without numbers.
This was my line of code
while ($row = mysql_fetch_array ($result,MYSQL_ASSOC) )
{
$viewers_home_ids[$row['viewer_id']] = $row['viewer_home_id'];
}
And this was its result with print_r
Array
(
[1] => 1
[2] => 1
[3] => 0
[4] => 2
[5] => 4
[6] => 2
[8] => 2
)
Is my array associative or not? And when arrays are associtive, how can I access a specific element in it directly? like array[6], I usually use foreach with my associative array, but I now have a situation where I don't want to go through the entire array to find a specific element.