我有一個php代碼,將顯示我有一個文件夾中的文件數量。從多個文件夾和回聲總數php計數文件
代碼:這將呼應這樣我的網頁上, 「共有119條是」
$directory = "../health/";
if (glob($directory . "*.php") != false) /* change php to the file you require either html php jpg png. */ {
$filecount = count(glob($directory . "*.php")); /* change php to the file you require either html php jpg png. */
echo "<p>There are a total of";
echo " $filecount ";
echo "Articles</p>";
} else {
echo 0;
}
問:
我想從計數文件27個或更多文件夾並回顯文件總數。
有沒有去,我可以添加文件夾列表打開,如:
$directory = "../health/","../food/","../sport/";
那麼它會計算所有的文件和顯示總
「共有394條是」感謝
究竟阻止你算來自這三個目錄中的文件? – hakre