FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a 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
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-2007 Frihost, forums powered by phpBB.