Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88835

excel file read rows and columns - php

$
0
0
$arr=array();
$row = -1;
if (($handle = fopen("out.csv", "r")) !== FALSE) {
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        $num = count($data);

        $row++;
        for ($c = 0; $c < $num; $c++) {
            $arr[$row][$c]= $data[$c];
        }
    }
    fclose($handle);
}

I'm using this code to read excel file data, this code counts elements in a row that are divided by comma (,),

Name, Surname, Num, Tel

  1. Name
  2. Surname
  3. Num
  4. tel

but in one field I have word Orginal, and this code also divides element by that word like this:

  1. Orgina
  2. l

and in that way, I receive wrong elemnts, any help?


Viewing all articles
Browse latest Browse all 88835

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>