this part has a problem
$filecsv = file_get_contents($uploadcsv);
$handle = fopen("$filecsv", "r");
Try replacing 3 lines with this.
$handle = fopen($uploadcsv, 'r');
Skip the first line
$column_headers = array();
$row_count = 0;
while (($data = fgetcsv($handle, 100000, ",")) !== FALSE)
{
if ($row_count==0)
{
$column_headers = $data;
}
else
{
print_r($data);
}
++$row_count;
}
source
share