How to read csv file in php

01
02
03
04
05
06
07
08
09
10
11
12
13
<?php
$aCsv = "data.csv";
$aRows = array();
$aHandle = fopen($aCsv, 'r');
if($aHandle !== FALSE) {
     while (($aData = fgetcsv($aHandle, 1000, ",")) !== FALSE)
     {
        $aRows[] = $aData;
     }
}
 
print_r($aRows);
?>