![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Nov 2005
Posts: 13
Rep Power: 0
![]() |
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... |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
|
|
#3 |
|
Expert Programmer
|
while ( ! feof($file) ) ...
|
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
|
|
#5 |
|
Expert Programmer
|
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.
|
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|