help with fscanf
View Single Post
03-02-2009, 08:15 PM
Join Date: Apr 2007
Originally Posted by
@Salathe: The problem with your code is that it requires me to load
line into PHP and then check it. I need to be able to do this with only fscanf if at all possible.
You'd need to fscanf every line so whether you use that or fgets you're still reading every single line (up until the one that matches). fscanf just parses a line according to the formatting string which you don't need to do; you just need to see if the line is the one you want. Unless I'm mistaken. There's no faster way to do what you want without going through the file line-by-line.
View Public Profile
Send a private message to Salathe
Visit Salathe's homepage!
Find More Posts by Salathe