0

whats good and simply way to convert csv file to 2d array, where i will be able to get value with

$rownumber=1;
$columnnumber=1;
foreach ($array['rows'] as $row) {
  foreach ($row as $value) {
    print($array[$rownumber][$columnnumber]);
  }
  print('<br>');
}

I've tried

$f = $_FILES["file"]['tmp_name'];
//move_uploaded_file($_FILES['file']['tmp_name'],'tmp/'.$_FILES['file']['name']);
$csvData=file_get_contents($_FILES['file']['tmp_name']);
$array['rows']=explode("\n",$csvData);
foreach ($array['rows'] as $value) {
  $array['rows']['values'] = explode(';',$value);
}

But i cant get exact column from row im currently on.

Dicanio
  • 3
  • 6

0 Answers0