How to get Data from Nested Array [Laravel]
<p>To the point, so in this question I want to embed Google Analytics Ecommerce tracking that has been needed for my company, in this case I have an array which is here</p>

<pre><code>data_diri": [

{

    "nama_pasien": "ahmad karim harahap",
    "email_pasien": null,
    "birth_date": "3",
    "birth_month": "06",
    "birth_year": "1965",
    "gender": "1",
    "alamat": "jalan jakarta",
    "cit_code": "0",
    "telp": "0211111",
    "layanan": "1",
    "home_service_date": "25",
    "home_service_month": "05",
    "home_service_year": "2016"

}
</code></pre>

<p>Sorry if there is an error with my json files but it was a valid json, so my question is how can I get the value of the child of "data_diri" value...</p>

<p>I am using return command from php e.g.</p>

<pre><code>return $result;
</code></pre>

<p>and to get "data_diri" I use:</p>

<pre><code>return $result[0]["data_diri"];
</code></pre>

<p>so how can I get the nested value of "data_diri"?
I am using</p>

<pre><code>return $result[0]["data_diri"]["nama_pasien"];
</code></pre>

<p>but it doesn't return anything but error "undefined index: nama_pasien", is there any suggestion?</p>

<p>Thanks</p>