import data php

Import large CSV data via PHP

Importing large data may cause Memory problems or timeout problems, here is how to avoid these problems.

$file = $_FILES['file']['tmp_name'];
        $handle = fopen($file, "r");
        while (($row = fgetcsv($handle, 0, ",")) !== FALSE) {
            // $row contains all the columns in a line in csv
            // insert into students(column1..., column2..., column3....) values($row[0],$row[1],$row[2]........)
         }