title: json to php Invalid argument supplied for foreach
body: <p>I have a Json file with data displayed below. im trying to insert into another file php code below to db. i keep getting  ERROR: Invalid argument supplied for foreach
  and i do not understand why</p>
  
  <pre><code>[{
    "DATE": "02-07-2017",
    "TIME": "08:20:48 AM",
    "ACCOUNT ID": "1000",
    "POSITION": "",
    "FIRST NAME": "",
    "LAST NAME": "",
    "ACCOUNT STATUS": "Active",``
    "REAL URL": ""
  },{
    "DATE": "02-07-2017",
    "TIME": "08:20:49 AM",
    "ACCOUNT ID": "1000",
    "POSITION": "",
    "FIRST NAME": "",
    "LAST NAME": "",
    "ACCOUNT STATUS": "Active",
    "REAL URL": ""
  },{
    "DATE": "02-07-2017",
    "TIME": "08:20:49 AM",
    "ACCOUNT ID": "1000",
    "POSITION": "Ceo",
    "FIRST NAME": "",
    "LAST NAME": "",
    "ACCOUNT STATUS": "Active",
    "REAL URL": ""
  }]
  
  $JSON_DATA = file_get_contents('Track.js');
  $CLEAN_DATA = json_decode($JSON_DATA, true);
  $stmt = $db-&gt;prepare("INSERT INTO `Track Employee` VALUES (?,?,?,?,?,?,?,?)");
  foreach (($CLEAN_DATA) as $row) {
    $stmt-&gt;bindParam(1, $row['DATE']);
    $stmt-&gt;bindParam(2, $row['TIME']);
    $stmt-&gt;bindParam(3, $row['ACCOUNT ID']);
    $stmt-&gt;bindParam(4, $row['POSITION']);
    $stmt-&gt;bindParam(5, $row['FIRST NAME']);
    $stmt-&gt;bindParam(6, $row['LAST NAME']);
    $stmt-&gt;bindParam(7, $row['ACCOUNT STATUS']);
    $stmt-&gt;bindParam(8, $row['REAL URL']);
  }
  </code></pre>