I have. CSV file. Some fields are empty, and some fields have commas or periods.
Now, how could I display it in this array?
Array ( [0] => Name1, name1@yahoo.com ,13,56475,,190000,,,remit,5-Mar-15,26250 [1] => Name2, name2@yahoo.com ,11,11250,,22500,,,the bank,30-Apr-15,6250 [2] => Name3, name3@yahoo.com ,15,,,1500,receipt,,the market,7-Mar-15,1750 [3] =>Name4, name4@yahoo.com ,21,25500,,46750,receipt,,bank ,7-Mar-15,21350 ..... )
At the moment, I can only display it like this:
Array ( [0] => Name1 [1] => name1@yahoo.com [2] => 13 [3] => 56475 [4] => [5] => 19000 [6] => [7] => [8] => remit [9] => 5-Mar-15 [10] => 26250 ) Array ( [0] => Name2 [1] => name2@yahoo.com [2] => 11 [3] => 11250 [4] => [5] => 22500 [6] => [7] => [8] => the bank [9] => 30-Apr-15 [10] => 6250 ) ....
And I use this code:
$file = fopen("pay.csv","r"); while(! feof($file)) { echo '<pre>',print_r(fgetcsv($file)),'</pre>'; } fclose($file);
I prefer to use my own csv functions.