国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > PHP > 正文

文件清單列表(酷)

2024-05-04 23:00:16
字體:
來源:轉載
供稿:網友
,歡迎訪問網頁設計愛好者web開發。[程序語言] php

[源碼來源] http://px.sklar.com
[功能描述] 該腳本從一個指定目錄中讀取文件名,之后把這些文件名返回到數組中,還包括文件個數。

源代碼如下:

<?
/*
this script read the filenames from a specified directory and returns them in an array.
the number of filenames is also returned.
copyleft(l) 1999 eric persson, [email protected], http://www.persson.tm/scripts/
*/
function searchdir($basedir)
{
global $filelisting, $number; //defines the two variables as global so they can be accessed from outside the function
unset($filelisting); //kills $filelisting in case it have been used earlier in the script
unset($number); //same as above
$handle=opendir($basedir);
while ($file = readdir($handle)) {
if ($file=="." or $file=="..") {
}
else {
$filelisting[]="$basedir$file";
};
};
$number=sizeof($filelisting); //gets the size of the array
};
searchdir("./"); //runs the function to search the current directory
echo $filelisting[1]; //echos the second value in the array
echo $number; //echos the size of the array
?>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 淳安县| 于都县| 新郑市| 化隆| 太湖县| 湖南省| 东莞市| 福清市| 阳原县| 隆回县| 河源市| 井陉县| 县级市| 兴宁市| 佛教| 威远县| 辽宁省| 桂平市| 连平县| 武强县| 山丹县| 肥东县| 新竹市| 邹平县| 克拉玛依市| 八宿县| 砀山县| 嘉鱼县| 榕江县| 泸水县| 曲水县| 厦门市| 屏东市| 商洛市| 城市| 大渡口区| 原阳县| 冷水江市| 重庆市| 乌什县| 休宁县|