title: Understanding array notation (specifically mysql_fetch_array and print_r)
body: <p>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:</p>
  
  <pre><code>Array ([column] =&gt; value [index] = value)
  </code></pre>
  
  <p>For example, if this is the table:</p>
  
  <pre><code>id fname lname
  1 John Smith
  </code></pre>
  
  <p>Then the print_r output of mysql_fetch_array will be:</p>
  
  <pre><code>Array ([id] =&gt; 1 [0] =&gt; 1 [fname] =&gt; John [1] =&gt; John [lname] =&gt; Smith [2] =&gt; Smith)
  </code></pre>
  
  <p>What is the reason for this notation? Specifically, why does the value repeat? Isn't that redundant? </p>
  
  <p>Also, can anybody recommend a good resource for a better conceptual understanding of arrays in general? Thanks!</p>