use php array in javascript?
<p>my php code looks like this:</p>

<pre><code>$result['firstName']['lastName']='johan';
echo json_encode($result);
</code></pre>

<p>how should i type to use this array in javascript with jquery?</p>

<pre><code>...function(data) {
    alert(data.firstName.lastName);
});
</code></pre>

<p>or</p>

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