I have some links stored in a database and i want to check if the files linked exist in the server. The server is different from the one i am running php on. I wrote a program that does this.....
-gets the link from database
-fopen the link at the address http://webserver
-getline
-check if line is of the file or a 404 page by using pregmatch().
I run that code for about 800 links. The links are for real audio files so for every link i run the code twice to check ram file and rm file.
That is about
1600 fopen statements
1600 pregmatch statements
1600 if statements
This process takes a long time 20 minutes or so and i wondered if there were any faster algorithms or functions i could use. the server i run php and mysql is pretty fast. The one i have stored the ram and rm files is average. Do i need to use fclose?
It does not seem to speed it up.
Thanks.
ed
edspace@home.com