News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Searching a text file

Started by DoctorToxn, May 31, 2005, 06:15:04 PM

Previous topic - Next topic

DoctorToxn

Hello.

I am having trouble with opening a text file and searching for a string inside it.  I am using the explode function to get the text file into the arrays.  But I cant find the way to search for a string and return the line number it is on.

(eg)
text.db file:"
1|username1|password1|email1
2|username2|password2|email2
3|username3|password3|email3"

I want to be able to search for "password2" and it return line number the string is on.  Any help will be apriciated.

Thanks,
BuilderDan

[Unknown]

I'm afraid you'll have to go through every line and check it.

-[Unknown]

Advertisement: