PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi. I am new to php programming, and i need a way to select the last file in the directory. (actually, i would like to select the newest/most recent file, but i got this working first.) Here is how i did, but i know there has to be a much more elegant way to do so... any suggestions are very appreciated.
if you use glob() without the NO_SORT flag, it will create an array and sort them by the date they were created. You could then array_pop() the array to get the file you want.