Page 1 of 1

count how many times...

Posted: Fri Oct 31, 2003 1:49 pm
by wesnoel
OK Basically I have a dir of csv files that are built each time a user submits a form. One of the form fields is named initials. What I would like to do is count how many times each user submitted the form on a daily , weekly, and monthly basis.

Basicly I want it to output like so:

WFN has submitted 16 time this month:

What would be the best way to do this?
Would I search through the entire dir and loop through each csv file?


Any hints or code sample or just a point in the right direction would help out a newbie.

TIA,

Wes/

Posted: Fri Oct 31, 2003 5:28 pm
by wesnoel
OK I have searched and could not find anything like this.

Just a point in the right direction would be cool

Wes/

Posted: Fri Oct 31, 2003 5:55 pm
by evilMind
Check out php.net/filesystem . Make sure to look at readdir() , opendir() , and a method that best suits you for opening files ( fpassthru(), fopen(), file() ).

Once you are able to access the directory and read the required files into an array, you should then consider using something like explode() (based on , ) to break up the information into logical pieces so you can manipulate it.

Hope that helps a little.