[wd_asp elements=’search’ ratio=’100%’ id=1]

Glob array by number value

7th June 2017

Php - Arrays

php codehaven

If you have sub-directories named 1 , 3 , 5 , 10

they will be arranged like this : 10, 1, 3, 5

To get them displaying like this 1, 3, 5, 10 use the following code


$images = glob($directory . "*.docx");
natsort($images);