title: print array element using foreach loop
body: <p>In my view i have     </p>
  
  <pre><code>forach($array as $arr)    
  {
  $data = array('fname' =&gt; $arr['first_name'],lname =&gt; $arr['lname']);    
  &lt;input type="hidden" value="&lt;?php print_r($data);?&gt;" name="fnameData[]"&gt;    
  }
  </code></pre>
  
  <p>Now i am submitting form to controller and print print_r($this->input->post(fnameData)) it prints following array </p>
  
  <pre><code>Array(
  
      [0] =&gt; Array([fname] =&gt; abc lname =&gt; aaa)
      [1] =&gt; Array([fname] =&gt; xyz lname =&gt; bbb)
  
  )
  </code></pre>
  
  <p>Now I want to print fname and lname both using <code>foreach loop</code> in controller</p>
  
  <p>It gives me Illegal string offset 'fname'</p>