Tuesday, 15 June 2010

Offsets of csv file when accessing through php? -



Offsets of csv file when accessing through php? -

i have little uncertainty regarding offsets. suppose have csv file this:

1 8 9 10 11 12 13 14 15 16 17 18 19 20

i using fgetcsv function retrieve info csv php page. here's code: $fp = fopen ("so-csv.csv","r"); $data = fgetcsv ($fp, 1000, ",") symbol date . . .

data[0] shows "1" data[1] undefined offset. var_dump($data[1]) displays null. believe accessing row-1 col-b of csv through data[1] null. how access next row (element 8)? thnx

while($data = fgetcsv($fp,1000, ",")) { // processing code here }

that's should need

php csv offset fgetcsv

No comments:

Post a Comment