Assume my csv file will get a two dimensional array, how to put them in $array[][]?
if (($handle = fopen($_SERVER['DOCUMENT_ROOT']."/file.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
for ($c=0; $c < $num; $c++) {
$dtary[$d][$c] = $data[$c];
if ($c == $num) {
$d++;
}
}
}
fclose($handle);
}
var_dump($dtary);
I am getting only last row of csv file.