remmingtonshowdown Posted February 20, 2009 Share Posted February 20, 2009 There ya go... Is there a method to make foreach() skip the first row? I'm running a csv but I want to skip the first row containing the headers... Thanks! Link to comment https://forums.phpfreaks.com/topic/146174-can-foreach-skip-first-row/ Share on other sites More sharing options...
premiso Posted February 20, 2009 Share Posted February 20, 2009 array_shift would "remove" the headers if that works. If not you can mvoe the internal array pointer with next to skip to the 2nd result. Link to comment https://forums.phpfreaks.com/topic/146174-can-foreach-skip-first-row/#findComment-767425 Share on other sites More sharing options...
The Little Guy Posted February 20, 2009 Share Posted February 20, 2009 or... little longer... $i = 0; foreach($arr as $a){ if($i != 0){ echo $a.'<br />'; } $i++; } Link to comment https://forums.phpfreaks.com/topic/146174-can-foreach-skip-first-row/#findComment-767429 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.