FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How many members?





DanielXP
I have this members area and it save the data into a file called members.txt

saved like this:

User name Password (encrypted)
User name Password (encrypted)
User name Password (encrypted)

I would like a script to count the lines

(As a flatfile users online does)

Could any one give me the code for this?
BlackSkad
Code:
$content = file ("members.txt");
$line_count = sizeof($content);
echo $line_count


file reads a file into an array. Each line is an element in the array. sizeof counts the number of elements in the array and saves it in $line_count. So $line_count will be the number of lines in your file.
DanielXP
Thanks it works Smile
Related topics
points...
Anime Section yeah!
some query about points
Memberships to MyEzy
China : Exam Cheaters go to prison
Me Thinks....
i find the forum here is interesting.
Need help
how many clicks on FRIHOST Forum Index - before you give up
Is the US an International Bully or the "free world sav
iam Makiyo
Map-Area Marking
Is the End of the World here?!
Alone & Many (50+50 coins)
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.