I have two questions:
1) I'm use the below code to output a list of sub-directories contained in the folder 'issues'. Each sub-directory is a number. I'd like to sort that output by increasing value, so 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... 20, 21 etc.
How can I do this?
<?php
chdir('issues');
$d = dir(".");
echo "<ul>";
while (false !== ($entry = $d->read()))
{
if (is_dir($entry) && ($entry != '.') && ($entry != 'sponsors') &&
($entry != '..'))
echo "<li><a href='{$entry}'>{$entry}</a></li>";
}
echo "</ul>";
$d->close();
?>
2) On a different part of the same page, I also want to output a link to the latest issue, i.e. the sub-directory with the highest number. How would I do that?
Thank you!