title: How to decode JSON data and show list using PHP
body: <p>I have some JSON data as follows:</p>
  
  <pre><code>{
      "TABLE": [{
          "ROW": [{
              "COL": [{
                  "DATA": "Buff momo"
              }, {
                  "DATA": "60.00"
              }, {
                  "DATA": "1;#"
              }, {
                  "DATA": "0"
              }, {
                  "DATA": "1"
              }, {
                  "DATA": "1"
              }, {
                  "DATA": "118"
              }, {
                  "DATA": "1;#{5D73B50D-2FFC-4D16-881E-D49328447AAB}"
              }, {
                  "DATA": "1;#0"
              }, {
                  "DATA": "2010-06-21 15:43:53"
              }, {
                  "DATA": "Miscellaneous"
              }, {
                  "DATA": "1;#Home/Lists/Canteen Menu/1_.000"
              }]
          }, {
              "COL": [{
                  "DATA": "Chicken drumstick"
              }, {
                  "DATA": "100.00"
              }, {
                  "DATA": "3;#"
              }, {
                  "DATA": "0"
              }, {
                  "DATA": "1"
              }, {
                  "DATA": "3"
              }, {
                  "DATA": "40"
              }, {
                  "DATA": "3;#{A1E0F087-57D3-4039-991B-E08B1CB3892A}"
              }, {
                  "DATA": "3;#0"
              }, {
                  "DATA": "2010-06-21 15:44:14"
              }, {
                  "DATA": "Chinese"
              }, {
                  "DATA": "3;#Home/Lists/Canteen Menu/3_.000"
              }]
          }
          }]
      }]
  }]
  }
  ""
  </code></pre>
  
  <p>I tried to decode it as follows:</p>
  
  <pre><code>header('Content-Type: application/json');
  $json_string = utf8_encode(file_get_contents("filename"));
  $parsed_json = json_decode($json_string, true);
  foreach ($parsed_json as $key =&gt; $value) {
  }
  </code></pre>
  
  <p>but to no avail. I am gettig errors as Invalid argument supplied for foreach().
  Where am I doing wrong?</p>