title: Parse JSON with PHP using foreach
body: <p>I've managed to decode and echo a JSON feed. After running this command</p>
  
  <pre><code>print_r(json_decode($data,true));
  </code></pre>
  
  <p>this is what I see on the screen:</p>
  
  <pre><code>Array
  (
    [sportId] =&gt; 29
    [last] =&gt; 96466864
    [league] =&gt; Array
      (
          [0] =&gt; Array
              (
                  [id] =&gt; 1980
                  [events] =&gt; Array
                      (
                          [0] =&gt; Array
                              (
                                  [id] =&gt; 667177156
                                  [starts] =&gt; 2016-11-26T15:00:00Z
                                  [home] =&gt; Hull City
                                  [away] =&gt; W.B.A
                                  [rotNum] =&gt; 2504
                                  [liveStatus] =&gt; 1
                                  [status] =&gt; O
                                  [parlayRestriction] =&gt; 2
                              )
                          [1] =&gt; Array
                              (
                                  [id] =&gt; 672139467
                                  [starts] =&gt; 2016-12-10T15:00:00Z
                                  [home] =&gt; Hull City
                                  [away] =&gt; Crystal Palace
                                  [rotNum] =&gt; 2510
                                  [liveStatus] =&gt; 1
                                  [status] =&gt; O
                                  [parlayRestriction] =&gt; 2
                              )
                          [2] =&gt; Array
                              (
                                  [id] =&gt; 676973849
                                  [starts] =&gt; 2016-12-26T15:00:00Z
                                  [home] =&gt; Burnley
                                  [away] =&gt; Middlesbrough
                                  [rotNum] =&gt; 2519
                                  [liveStatus] =&gt; 1
                                  [status] =&gt; O
                                  [parlayRestriction] =&gt; 2
                              )
                          )
                  )
          )
  )
  </code></pre>
  
  <p>I need to be able to use <strong>foreach</strong> to go through each [events] in this associative array, and to be able to get the result such as this:</p>
  
  <pre><code>Hull City v W.B.A.
  Hull City v Crystal Palace
  Burnley v Middlesbrough
  </code></pre>
  
  <p>I think everything is already parsed correctly and now it's just a matter of using the correct syntax to echo the result from the associative array, which I cannot do myself.</p>