I'm new at PHP and I was wanting to create a text file to count uploads to my site. Going with a txt file, because my host doesn't support sql databases. I got some help from someone else on here, with some code on how to read the data from a text
file, separated by commas'.
$filename = "blah.txt";
$file = file($filename);
for($count=0;$count<count($file);$count++)
{
$line = explode(",",$file[$count]);
//$line will be an array containing
//each value that was seperated by a comma
echo $line[0];
echo $line[1];
echo "<br>";
}
But I'm wanting to do a an if statement and list the 5 top uploaders, but it will need to be able to search through the document. I am able to do an if statment, but it only does the last line in my blah.txt since its not keeping track of the variables. Is this possible with a txt file, or should I just find another host that supports sql?