title: fputcsv Notice: Array to string conversion
body: <p>I have a simple PHP code to save JSON to CSV , but I have an error, this the code:</p>
  <pre><code>&lt;?php
  $inputJSON = file_get_contents('https://url');
  
  $out = fopen('C:\xampp\htdocs\tkp_product\tkp2.csv', 'w');
  foreach(json_decode($inputJSON, true)[&quot;data&quot;] as $key =&gt; $value) {
    fputcsv($out, $value);
  }
  fclose($out);
  
  ?&gt;
  </code></pre>
  <p>This for error for <code>fputcsv($out, $value);</code></p>
  <blockquote>
  <p>Notice: Array to string conversion in C:\xampp\htdocs\tkp.php on line 6</p>
  <p>Notice: Array to string conversion in C:\xampp\htdocs\tkp.php on line 6</p>
  </blockquote>
  <p>I'm running this script using XAMPP in Win 10 with PHP7 installed. What should I do to resolve this issue?</p>