I am using scandir to list the files. I get below array list
Code:
$dir = array_slice(scandir(\Yii::getAlias('@frontend/web/ads/')), 2);
print_r($dir);
Actual Output:
Array ( [0] => IX [1] => V [2] => VI [3] => VII [4] => VIII [5] => X [6] => XI )
Expected Output:
Array ( [0] => V [1] => VI [2] => VII [3] => VIII [4] => IX [5] => X [6] => XI )
Problem:
I created directories in order as V, VI, VII and so on. How can I arrange the files in the order they were created in PHP?