I have files with names increasing in number, such as
filename0001.php
filename0002.php
filename0003.php
filename0004.php
filename0005.php
etc.
From the index.php page I would like to have a link that points to the filename with latest (greater) number in its name, so that first it points to filename0005.php but as soon as the filename0006.php is added, the link points to the new file instead.
How can this be achieved?
Linking to the latest fileNAME
Moderator: General Moderators
Re: Linking to the latest fileNAME
Code: Select all
asort($filenamearray);
$lastfile = array_pop($filenamearray);