title: Get Data from Array PHP
body: <p>I cant quite get my data from an array, it just shows a blank list of 3 list items when I run my foreach loop. </p>
  
  <p>When I print my array it looks like this -></p>
  
  <pre><code>Array
  (
      [1] =&gt; Array
          (
              [id] =&gt; 10
              [orderinfo] =&gt; Array
              [userid] =&gt; 210
              [date] =&gt; 2013-06-20 13:46:27
          )
  
      [2] =&gt; Array
          (
              [id] =&gt; 18
              [orderinfo] =&gt; helo
              [userid] =&gt; 210
              [date] =&gt; 2013-06-20 15:04:58
          )
  
      [3] =&gt; Array
          (
              [id] =&gt; 19
              [orderinfo] =&gt; {"order":[{"id":"2","name":"Basil Cress","qty":"1"},{"id":"4","name":"Sakura Mix","qty":"1"},{"id":"6","name":"Beetroot Shoots","qty":2},{"id":"28","name":"Celery","qty":2},{"id":"24","name":"Orange Capsicums","qty":"1"}]}
              [userid] =&gt; 210
              [date] =&gt; 2013-06-20 15:06:46
          )
  
  )
  </code></pre>
  
  <p>My code so far..</p>
  
  <pre><code>foreach ($orderdata as $item) {
  
      $orderinfo = json_decode($item-&gt;orderinfo, true);
  
      $orderitem[] = array(
          'date' =&gt; $item-&gt;date,
          'productname' =&gt; $orderinfo['name'],
          'productqty' =&gt; $orderinfo['qty'],
      );              
  }
  
  
  echo "&lt;pre&gt;";
  print_r($orderdata);
  echo "&lt;/pre&gt;";
  ?&gt;
  
  
  
  &lt;?php foreach ($orderitem as $orderitems) {   ?&gt;
    &lt;li&gt; 
      &lt;?php echo  $orderitems['date']; ?&gt;
    &lt;/li&gt;
  &lt;?php }; ?&gt;
  </code></pre>