-1

The parser does not work on large CSV files. CSV file 70M What could be the problem?

  function parses($f) {
    if (($f = fopen('84k.csv', 'r')) !== FALSE) {
for ($json = array(); $row = fgetcsv($f, 2000);) {
             $json[] = array( 'model'=>$row[2], 'detal'=>$row[1],'dop' => array( 'nam'=>$row[0], 'sum'=>$row[4], 'img'=>'http://'.$row[5], 'info'=>$row[6]) );
}
            fclose($f);
            json_encode($json, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
            file_put_contents('file/newsss1d.json', json_encode($json, JSON_UNESCAPED_UNICODE));

        }
}
parses();
Harsh Patel
  • 5,503
  • 7
  • 33
  • 62

1 Answers1

-1

Try increasing your memory limit:

ini_set(’memory_limit’, ‘128M’);
delboy1978uk
  • 11,504
  • 2
  • 18
  • 37