title: Read and print json array in php
body: <p>I have a JSON array like below. I want to print only the values of the name. But I am getting undefined index name and getting value of name.below is my json.</p>
  
  <pre><code>[{"docId":{"id":"57dd70252a896558e573a0c8"},"docProfile":{"name":"gowtham","gender":null,"email":null,"mobile":"7406339908"},"docLocalInfo":{"username":"gowtham","otp":934343,"newPasswordToken":null,"tempMobile":"","adminVerfiy":null},"privateInfo":{"mciNumber":null,"aadharNumber":null,"panNumber":null},"tempHospitals":[],"bankInfo":null,"signupSteps":{"accountCreated":true,"otpValidated":true},"notification":null,"hospitals":[],"address":null}]
  </code></pre>
  
  <p>my code</p>
  
  <pre><code>foreach($doc_array as $data =&gt; $mydata)
      {
            foreach($mydata as $key=&gt;$val)
            {
                echo $val['name'];
            }
      }
  </code></pre>
  
  <p>How to get the values of name from docProfile? Any help would be greatly appreciated</p>