title: javascript json object decode
body: <p>I am new to JSON and AJAX and was hoping someone could help me out here.</p>
  
  <p>Using an AJAX request to a PHP script, I get some data from SQL database -> encoded as JSON string and sent it back to the calling javascript.</p>
  
  <p>This is the data i get back</p>
  
  <pre><code>Array[{"categoryName":"Apartments For Rent"},{"categoryName":"Apartments For Sale"},{"categoryName":"Room For Rent (Shared)"},{"categoryName":"Paying Guest"},{"categoryName":"Office\/Shop\/Commercial Space"},{"categoryName":"Land"},{"categoryName":"Parking Spots"},{"categoryName":"Other"}]
  </code></pre>
  
  <p>How can I get the individual 'CategoryName' values from this (in a while loop)?</p>
  
  <p>EDIT : PHP CODE THAT SENDS THE JSON DATA</p>
  
  <pre><code>    $arr = array();
      while($row = mysql_fetch_array($temp,MYSQL_ASSOC))
      {
          $arr[]=$row;
      }
      echo json_encode($arr);
  </code></pre>
  
  <p>Thank you for the help<br>
  Ankit</p>