title: Parse JSON to variable or MySQL
body: <p>Sorry for the question I am not PHP skiller :)</p>
  <p>I have a problem with parsing data from JSON.
  This is my JSON after dump</p>
  <pre><code>$response = curl_exec($ch);
  $data = json_decode($response, true);
  $c = count($data['products']);
  var_dump($data);
  
  array(4) {
    [&quot;products&quot;]=&gt;
    array(23347) {
      [0]=&gt;
      array(25) {
        [&quot;name&quot;]=&gt;
        string(15) &quot;DOOKY Strieška&quot;
        [&quot;description&quot;]=&gt;
        string(0) &quot;&quot;
        [&quot;count&quot;]=&gt;
        float(0)
        [&quot;measureType&quot;]=&gt;
        string(2) &quot;ks&quot;
        [&quot;price&quot;]=&gt;
        float(20.83)
        [&quot;vat&quot;]=&gt;
        float(20)
        [&quot;stockCardNumber&quot;]=&gt;
        string(6) &quot;000004&quot;
        [&quot;typeId&quot;]=&gt;
        int(1)
        [&quot;warehouseCode&quot;]=&gt;
        string(3) &quot;MOL&quot;
        [&quot;timestamp&quot;]=&gt;
        string(19) &quot;2019-05-09T10:38:30&quot;
        [&quot;foreignName&quot;]=&gt;
        string(0) &quot;&quot;
        [&quot;customText&quot;]=&gt;
        string(12) &quot;silver stars&quot;
        [&quot;warrantyPeriod&quot;]=&gt;
        float(0)
        [&quot;weightPerUnit&quot;]=&gt;
        float(0)
        [&quot;volumePerUnit&quot;]=&gt;
        float(0)
        [&quot;numberingSequenceCode&quot;]=&gt;
        string(2) &quot;SK&quot;
        [&quot;ean&quot;]=&gt;
        string(13) &quot;5038278982969&quot;
        [&quot;stn&quot;]=&gt;
        string(0) &quot;&quot;
        [&quot;jkpov&quot;]=&gt;
        string(6) &quot;126367&quot;
        [&quot;din&quot;]=&gt;
        string(0) &quot;&quot;
        [&quot;bn&quot;]=&gt;
        string(0) &quot;&quot;
        [&quot;plu&quot;]=&gt;
        int(0)
        [&quot;warrantyPeriodTypeId&quot;]=&gt;
        int(0)
        [&quot;priceWithVat&quot;]=&gt;
        float(25)
        [&quot;eshop&quot;]=&gt;
        NULL
      }
  </code></pre>
  <p>I need to get every EAN, JKPOV, COUNT to variable, and insert to MySQL</p>
  <p>I have this code but it doesn't work properly, because not write me all data. But in <code>var_dump($data);</code> I have this missing data...</p>
  <pre><code>$i=0;
  for ($i=0; $i &lt;= $c; $i++) {
  $ean = $data['products'][$i]['ean'];
  $count = $data['products'][$i]['count'];
  $jkpov = $data['products'][$i]['jkpov'];
  conf::$db-&gt;query(&quot;insert ignore into sklad set `ean`='$ean', `jkpov`='$jkpov', `count`='$count'&quot;);
  $i++; }
  </code></pre>