when trying upload csv file in php , exporting fields in php using fgetcsv function, returned result in 1 array instead of comma separated. have 2 csv file in 1 working , in showing values in 1 array this:
array ( [0] => name [1] => number [2] => tax center john12 [3] => 2122561681 [4] => 71 west 19 john13 [5] => 6462102791 [6] => 72 west 19 john14 [7] => 9144190749 [8] => 73 west 19 john15 [9] => 8602867600 [10] => 74 west 19 john16 [11] => 8602435024 [12] => 75 west 19 john17 [13] => 8602429299 [14] => 76 west 19 john18 [15] => 2034838300 [16] => 77 west 19
here code first row of csv
if(($handle = fopen($file , "r")) !== false) { $fileadded = true; $adcon = 0; while (($data = fgetcsv($handle, 0, ",")) !== false) { /*echo '<pre>'; print_r($data); echo '</pre>';*/ $first = $data; break; } fclose($handle); }
Comments
Post a Comment