Comdemned Posted October 20, 2007 Share Posted October 20, 2007 Hi people. I am having a problem figuring out how to drop the first like returned using fgetcsv. <?php while (($line = fgetcsv($fp, 1024, ",")) !== FALSE){ } ?> I need to drop the first line only from the csv file and display the rest. I have searched the forums and google and thus far come up short on finding out how to drop the first line. any help would be greatly appreciated. Thanks Murray Link to comment https://forums.phpfreaks.com/topic/74049-solved-fgetcsv-drop-first-line/ Share on other sites More sharing options...
Barand Posted October 20, 2007 Share Posted October 20, 2007 <?php $first = true; while (($line = fgetcsv($fp, 1024, ",")) !== FALSE){ if ($first) { $first = false; continue; } // process csv data } ?> Link to comment https://forums.phpfreaks.com/topic/74049-solved-fgetcsv-drop-first-line/#findComment-373860 Share on other sites More sharing options...
Comdemned Posted October 20, 2007 Author Share Posted October 20, 2007 Thanks Barand worked a charm. Link to comment https://forums.phpfreaks.com/topic/74049-solved-fgetcsv-drop-first-line/#findComment-373891 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.