title: How to get specific field of an associative array without using a loop?
body: <p>I want to get a specific field of an array but it keeps on sending me error like <code>Undefined index: in</code> or <code>Cannot use object of type stdClass as array in</code>.I'm using codeigniter and this array is from my model and it is returned in my controller. Here is my controller.</p>
  
  <pre><code>  $data['inpatient'] = $this-&gt;billing_model-&gt;retrieveinpatient();
    echo $data['inpatient']['in'];
  </code></pre>
  
  <p>Here is the structure of my array:</p>
  
  <pre><code> Array
   (
    [inpatient] =&gt; Array
      (
          [0] =&gt; stdClass Object
              (
                  [iid] =&gt; 1
                  [in] =&gt; IN
              )
      )
  
  )
  </code></pre>
  
  <p>Any help?</p>