title: Multidimensional array only returns first indexes
body: <p>I know there are lot's of posts with the same title, however, my problem is partially fixed.</p>
  
  <p>Printing the Array:</p>
  
  <pre><code> $data['posts'] = $this-&gt;model_mutamba-&gt;getPosts($email);
   print_r('&lt;pre&gt;');
   print_r( $data['posts']);
   print_r('&lt;pre&gt;');
  </code></pre>
  
  <p>The Array:</p>
  
  <pre><code> Array
  (
  [0] =&gt; Array
      (
          [0] =&gt; stdClass Object
              (
                  [post_id] =&gt; 5
                  [aluno_id] =&gt; 3
                  [post_text] =&gt; Hello my name is Joana!
                  [post_image] =&gt; 
                  [post_video] =&gt; 
                  [post_comments] =&gt; 
                  [post_likes] =&gt; 0
                  [post_flags] =&gt; 0
                  [post_date] =&gt; 2014-12-11 03:03:33
              )
  
      )
  
  [1] =&gt; Array
      (
          [0] =&gt; stdClass Object
              (
                  [post_id] =&gt; 3
                  [aluno_id] =&gt; 1
                  [post_text] =&gt; Mestre zeca na area!
                  [post_image] =&gt; 
                  [post_video] =&gt; 
                  [post_comments] =&gt; 0
                  [post_likes] =&gt; 0
                  [post_flags] =&gt; 0
                  [post_date] =&gt; 2014-12-10 19:37:16
              )
  
          [1] =&gt; stdClass Object
              (
                  [post_id] =&gt; 4
                  [aluno_id] =&gt; 1
                  [post_text] =&gt; ulalalala
                  [post_image] =&gt; 
                  [post_video] =&gt; 
                  [post_comments] =&gt; 0
                  [post_likes] =&gt; 0
                  [post_flags] =&gt; 0
                  [post_date] =&gt; 2014-12-10 21:00:29
              )
  
      )
  
  [2] =&gt; Array
      (
          [0] =&gt; stdClass Object
              (
                  [post_id] =&gt; 1
                  [aluno_id] =&gt; 10
                  [post_text] =&gt; olaaa a todossss
                  [post_image] =&gt; 
                  [post_video] =&gt; 
                  [post_comments] =&gt; 0
                  [post_likes] =&gt; 0
                  [post_flags] =&gt; 0
                  [post_date] =&gt; 2014-12-10 05:18:11
              )
  
          [1] =&gt; stdClass Object
              (
                  [post_id] =&gt; 2
                  [aluno_id] =&gt; 10
                  [post_text] =&gt; mais umas vez estamos aqui e brindar.
                  [post_image] =&gt; 
                  [post_video] =&gt; 
                  [post_comments] =&gt; 0
                  [post_likes] =&gt; 0
                  [post_flags] =&gt; 0
                  [post_date] =&gt; 2014-12-10 15:17:26
              )
  
      )
  
  )
  </code></pre>
  
  <p>My project in in CodeIgniter, I tried to loop it like:</p>
  
  <pre><code>if ("" != $posts) {
      foreach ($posts as $object) { 
          $p = $object[0];
          echo "&lt;br&gt;" . $p-&gt;post_text;
      }
  }       
  </code></pre>
  
  <p>It shows the text from the posts but not all of them. It only shows the items in the at the [0] index. I also tried something like:</p>
  
  <pre><code>$i = -1;
  foreach ($posts as $object) { 
      $i++;                             
      $p = $object[$i];
      echo "&lt;br&gt;" . $p-&gt;post_text;
  }
  </code></pre>
  
  <p>But getting "Undefined offset 2".</p>
  
  <p>I know it must be something simple i'm missing. 
  Any help will be greatly appreciated.</p>