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? 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. 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 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
Archived
This topic is now archived and is closed to further replies.