CODE:
if ($handle = opendir('./papka')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$files[] = $file; } }
closedir($handle); }
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$files[] = $file; } }
closedir($handle); }
При выводе массива:
print_r($files);
Выдаёт это:
CODE:
Array
(
[0] => 1.htm
[1] => 10.htm
[2] => 11.htm
[3] => 12.htm
[4] => 13.htm
[5] => 14.htm
[6] => 15.htm
[7] => 16.htm
[8] => 17.htm
[9] => 18.htm
[10] => 19.htm
[11] => 2.htm
[12] => 20.htm
[13] => 21.htm
[14] => 22.htm
[15] => 23.htm
[16] => 24.htm
[17] => 25.htm
[18] => 26.htm
[19] => 27.htm
[20] => 28.htm
[21] => 29.htm
[22] => 3.htm
)
(
[0] => 1.htm
[1] => 10.htm
[2] => 11.htm
[3] => 12.htm
[4] => 13.htm
[5] => 14.htm
[6] => 15.htm
[7] => 16.htm
[8] => 17.htm
[9] => 18.htm
[10] => 19.htm
[11] => 2.htm
[12] => 20.htm
[13] => 21.htm
[14] => 22.htm
[15] => 23.htm
[16] => 24.htm
[17] => 25.htm
[18] => 26.htm
[19] => 27.htm
[20] => 28.htm
[21] => 29.htm
[22] => 3.htm
)
Т.е. после 1 следует 10.
После 19 следует 2.
Как упорядочить, чтобы был обычный порядок?
После 1 следовало 2, а не 10?