How do I organize a list using scandir()?

I'm using scandir() on a webpage to populate a list of archived threads for a Wakaba image board. Because of the numbers, the webpage files display in a weird order.

The page is here: http://sturmkrieg.ru/img/archive/

The source is here: https://gist.github.com/Pavelovich/0f840516f6c2f14986ef

1 Reply

You can sort the scandir() array and then use your for (or foreach). Specifically, check out the 'sorting_order' parameter. PHP's guide might help you in this case:

http://php.net/manual/en/function.scandir.php

Thanks,

Dave.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct