Can't read json_encode : <p>I'm having an issue. I have a json_encode array in php. With ajax, I get back in my javascript script. </p>

<p><strong>php</strong></p>

<pre><code>&lt;?php
$code = 'xyz';
$email = 'xyz@gmail.com';
$back = array();
array_push($back, array("code" =&gt; $code,"email" =&gt; $email));
echo json_encode($back);
?&gt;
</code></pre>

<p><strong>ajax callback function</strong></p>

<pre><code>function(data){
alert(data);
alert(data[0].code);
}
</code></pre>

<p>When I try to alert data, I get <code>[{"code":"xyz","email":"xyz@gmail.com"}]</code></p>

<p>Now when I try to alert the code (or the email) it says <code>undefined</code>. </p>

<p>Can you help me alert data[0].code properly ? </p>
