ifubad Posted August 30, 2008 Share Posted August 30, 2008 When using fgetcsv, it reads in line by line, but I don't want to read in the header of the csv file, is there an easier way to not read that first line? Or, is the only way to do that is to check either using a conditional statement to skip the first read OR check $array[0] and then determine what to do with it? Quote Link to comment https://forums.phpfreaks.com/topic/122020-solved-fgetcsv-how-not-to-retreive-the-csv-header/ Share on other sites More sharing options...
genericnumber1 Posted August 30, 2008 Share Posted August 30, 2008 You can array_shift() off the first line (assuming you group lines by array elements). That will also reset all of the numeric keys to start from 0 again (assuming they're numeric), so you can act like it was never there. Quote Link to comment https://forums.phpfreaks.com/topic/122020-solved-fgetcsv-how-not-to-retreive-the-csv-header/#findComment-629859 Share on other sites More sharing options...
ifubad Posted August 30, 2008 Author Share Posted August 30, 2008 perfect, thank you Quote Link to comment https://forums.phpfreaks.com/topic/122020-solved-fgetcsv-how-not-to-retreive-the-csv-header/#findComment-629870 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.