paulman888888 Posted August 9, 2008 Share Posted August 9, 2008 How do i when reading a file ship the 1st 6 lines? I have looked on google and php.net Thankyou Paul Quote Link to comment Share on other sites More sharing options...
ratcateme Posted August 9, 2008 Share Posted August 9, 2008 so do you just want the first 6 lines or do you want to dump them you could do something like this //first 6 lines $fh = fopen("file","r"); $line = 1; while(!feof($fh)){ if($line > 6) break; $data .= fgets($fh); $line++; } //skip first 6 lines $fh = fopen("file","r"); $line = 1; while(!feof($fh)){ if($line > 6){ fgets($fh); $line++; }else{ $data .= fgets($fh); } $line++; } Scott. Quote Link to comment 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.