Question:

Latest file, PHP????

by Guest62654  |  earlier

0 LIKES UnLike

I have multiple files such as 01_edit.html, 02_edit.html, etc etc etc with the largest number being the newest. How can i assign the variable $newestfile to the filename of the newest file in the directory based off the knowledge that everything before the _ is a number and the highest is the newest. Thank you.

 Tags:

   Report

1 ANSWERS


  1. I had something like that a few years ago, I just had a small config php file that had a few variables in it, one of them was the counter.

    every time my script added a new number, it automaticallly changed the total number in the config file to ++

    Simple workaround, hope its useful

You're reading: Latest file, PHP????

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.