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 Quote 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 } ?> Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.