I want to count total number of rows with data in csv. I did following:
<?php echo count(file('example.csv',FILE_IGNORE_NEW_LINES |` `FILE_SKIP_EMPTY_LINES)); ?>
Here, if all the values are only in first column then output is correct.
eg. Row1Col1='a'
& Row4Col1='b'
o/p=2 correct because data in rows are
Row1->'a',Row2->'',Row3->'',Row4->'b'
But if values are in different column then get wrong output.
eg. Ro1Col3='a'
& Row4Col1='b'
o/p=4 wrong (want correct output is 2) because data in rows are
Row1->'a', Row2->',,' Row3->',,' Row4->'b'.
Thanks, Jaydeep