Файлы. Список файлов в текущей папке на php
<?
$a=dirname(__FILE__);
$b=scandir($a);print_r($b);
$c=scandir($a,1);print_r($c)
?>
1. По алфавиту с начала
Array ( [0] => . [1] => .. [2] => 0.php [3] => index.php [4] => mysql1.php [5] => mysql2 [6] => mysql2.php [7] => mysql3.php [8] => mysql4.php [9] => mysql5.php [10] => mysql6.php [11] => mysql7.php [12] => mysql8 [13] => mysql9 [14] => mysql9.php [15] => ph1.php [16] => ph10.php [17] => ph11 [18] => ph12 [19] => ph13.php [20] => ph14.php [21] => ph15.php [22] => ph16.php [23] => ph17 [24] => ph18.php [25] => ph19 [26] => ph2.php [27] => ph20.php [28] => ph21 [29] => ph21.php [30] => ph22 [31] => ph22.php [32] => ph23 [33] => ph23.php [34] => ph24.php [35] => ph25 [36] => ph26 [37] => ph27.php [38] => ph28 [39] => ph28.php [40] => ph29.php [41] => ph3.php [42] => ph30 [43] => ph31.php [44] => ph32.php [45] => ph33.php [46] => ph34 [47] => ph35 [48] => ph36.php [49] => ph37.php [50] => ph38.php [51] => ph39.php [52] => ph4.php [53] => ph40.php [54] => ph41.php [55] => ph42.php [56] => ph43 [57] => ph43.php [58] => ph44.php [59] => ph45.php [60] => ph46.php [61] => ph47 [62] => ph47.php [63] => ph48.php [64] => ph49.php [65] => ph5.php [66] => ph50 [67] => ph51 [68] => ph52.php [69] => ph53 [70] => ph54.php [71] => ph55.php [72] => ph56.php [73] => ph57 [74] => ph58 [75] => ph58.php [76] => ph59.php [77] => ph6.php [78] => ph60.php [79] => ph61.php [80] => ph62 [81] => ph63 [82] => ph64 [83] => ph65.php [84] => ph66 [85] => ph67.php [86] => ph68.php [87] => ph69.php [88] => ph7.php [89] => ph70.php [90] => ph71.php [91] => ph72 [92] => ph73 [93] => ph74 [94] => ph75.php [95] => ph8 [96] => ph8.php [97] => ph9 [98] => ph9.php )
2. По алфавиту с конца
Array ( [0] => ph9.php [1] => ph9 [2] => ph8.php [3] => ph8 [4] => ph75.php [5] => ph74 [6] => ph73 [7] => ph72 [8] => ph71.php [9] => ph70.php [10] => ph7.php [11] => ph69.php [12] => ph68.php [13] => ph67.php [14] => ph66 [15] => ph65.php [16] => ph64 [17] => ph63 [18] => ph62 [19] => ph61.php [20] => ph60.php [21] => ph6.php [22] => ph59.php [23] => ph58.php [24] => ph58 [25] => ph57 [26] => ph56.php [27] => ph55.php [28] => ph54.php [29] => ph53 [30] => ph52.php [31] => ph51 [32] => ph50 [33] => ph5.php [34] => ph49.php [35] => ph48.php [36] => ph47.php [37] => ph47 [38] => ph46.php [39] => ph45.php [40] => ph44.php [41] => ph43.php [42] => ph43 [43] => ph42.php [44] => ph41.php [45] => ph40.php [46] => ph4.php [47] => ph39.php [48] => ph38.php [49] => ph37.php [50] => ph36.php [51] => ph35 [52] => ph34 [53] => ph33.php [54] => ph32.php [55] => ph31.php [56] => ph30 [57] => ph3.php [58] => ph29.php [59] => ph28.php [60] => ph28 [61] => ph27.php [62] => ph26 [63] => ph25 [64] => ph24.php [65] => ph23.php [66] => ph23 [67] => ph22.php [68] => ph22 [69] => ph21.php [70] => ph21 [71] => ph20.php [72] => ph2.php [73] => ph19 [74] => ph18.php [75] => ph17 [76] => ph16.php [77] => ph15.php [78] => ph14.php [79] => ph13.php [80] => ph12 [81] => ph11 [82] => ph10.php [83] => ph1.php [84] => mysql9.php [85] => mysql9 [86] => mysql8 [87] => mysql7.php [88] => mysql6.php [89] => mysql5.php [90] => mysql4.php [91] => mysql3.php [92] => mysql2.php [93] => mysql2 [94] => mysql1.php [95] => index.php [96] => 0.php [97] => .. [98] => . )