Following the Automatic Image Gallery System.
Is there a way to display the images in a certain order.
Basically I want to have the images displayed in the order of the most recently added image.
So date order.
I have a file upload function, which I can use to add new photos to the gallery,
hence why I'd like to display new images first.
If anyone can help, thanks
Image Gallery - how to sort images. [SOLVED]
Re: Image Gallery - how to sort images. [SOLVED]
I've found the solution.
http://www.w3schools.com/php/func_array_multisort.asp
$images = glob("*.{jpg,jpeg,png,gif}", GLOB_BRACE); array_multisort( array_map( 'filemtime', $images ), SORT_NUMERIC, SORT_DESC, $images );The array_multisort() function is explained here:
http://www.w3schools.com/php/func_array_multisort.asp
Re: Image Gallery - how to sort images. [SOLVED]
I just learnt something
I was going to suggest a usort() but that way looks much nicer,
I was going to suggest a usort() but that way looks much nicer,
Re: Image Gallery - how to sort images. [SOLVED]
haha, you're welcome.