Do functions that print arrays all use the same notation to do so? What is the reasoning for one notation over another? I noticed when using PHP print_r to display an array compiled using mysql_fetch_array, the notation of the array is as follows:
Array ([column] => value [index] = value)
For example, if this is the table:
id fname lname
1 John Smith
Then the print_r output of mysql_fetch_array will be:
Array ([id] => 1 [0] => 1 [fname] => John [1] => John [lname] => Smith [2] => Smith)
What is the reason for this notation? Specifically, why does the value repeat? Isn't that redundant?
Also, can anybody recommend a good resource for a better conceptual understanding of arrays in general? Thanks!