Reputation: 157
I am using the following code to include all of the files in the directory 'versions'
<?php
foreach (glob("versions/*.php") as $filename)
{
include $filename;
}
?>
This works well to show the files in the order like 1.1, 1.2, 1.2-1, 1.2-2, 1.3 and so on, but I'd like the order of the files to be reversed. Would this be possible in any way?
Upvotes: 2
Views: 91
Reputation: 799100
foreach (array_reverse(glob("versions/*.php")) as $filename)
Upvotes: 2