title: Getting key => value from json array passed from php
body: <p>I am trying to get an array from PHP and to manipulate it further using jQuery. In my PHP file i do <code>echo json_encode($data)</code> and when i put an alert in my response in jQuery i get:</p>
  
  <pre><code>[
      {
          "CustomerID": "C43242421",
          "UserID": "432421421",
          "Customer": "rqewrqwreeqwr",
          "Add1": "rqwerqwreqwrqwrqwr",
          "Add2": "&amp;nbsp;",
          "Add3": "&amp;nbsp;",
          "Phone": "4131231",
          "Fax": "532442141",
          "Contact": "reqwrqwrw",
          "Email": "gfdgdsg",
          "PaymentTerm": null,
          "Country": "3231",
          "City": "111",
          "Zip": "&amp;nbsp;"
      }
  ]
  </code></pre>
  
  <p>, wich is a valid json array. Now what i try to do further is get the pairs as key => value as i would in an associative array in php.</p>
  
  <pre><code>$.post("templates/test.php",
      {data: query,
       cond: $(this).text(),
       action: 'select'
       },
  function(res) {
      alert(res) //outputs what i pasted above
      $.each($.parseJSON(res), function(key, value) {
          alert(key + value);
          //this outputs: 0[object Object]
  });
  </code></pre>
  
  <p>Removing the <code>$.parseJSON</code> in the above function gives me a <code>invalid 'in' operand e on jquery.min.js(line 3)</code> in Firebug error log.Can you assist me with my troubles? </p>