I have to list directories by using scandir() function but result array should be sorted according to date and time of directory created.
Regards Deepak
必要な結果を配列に取得して並べ替えます...これを直接実行できる scandir オプションを知りません。
scandir() ではできません。
これをチェック
関数を使用することで問題を解決できますfilemtime($dirPath)
。
コードサンプル:
if (file_exists($dirPath)) {
echo "last modified: " . date ("F d Y H:i:s.", filemtime($dirPath));
}