Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 10th, 2006, 6:22 PM   #1
bmad6
Newbie
 
Join Date: Nov 2005
Posts: 13
Rep Power: 0 bmad6 is on a distinguished road
Question EOF Detection

I have this script to read one line at a time out of an online file (fopen, then fgets), but it can't detect the end of the file yet. How do i do this? if(fgets($file)) or something?

Thank you for your help...
bmad6 is offline   Reply With Quote
Old May 10th, 2006, 7:40 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I highly recommend the PHP manual. Read about the functions you use. While you're reading about them, you may notice others that are even more suitable to your purposes. To answer your question, go here. To answer other questions about how to get answers to questions, refer to the forum's rules/FAQ, a "How to Post..." thread, etc.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old May 10th, 2006, 9:11 PM   #3
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 837
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
while ( ! feof($file) ) ...
titaniumdecoy is online now   Reply With Quote
Old May 10th, 2006, 9:53 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I would suggest that it's in the OP's best interest to learn how to learn. The answer you give is on that linked page, in a highlighted gray box....
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old May 10th, 2006, 10:05 PM   #5
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 837
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
I agree. However, I also think it's a good thing to have said information posted in many places on the 'net. Nothing is more annoying (to me) than searching for something and finding only links to the same website, which may or may not be helpful, and may or may not exist at some point in the future.
titaniumdecoy is online now   Reply With Quote
Old May 11th, 2006, 6:24 AM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I wouldn't regard the PHP Manual isn't just any ol' link. Strictly personal opinion, of course. Opinion doesn't guarantee factuality.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:16 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC