PHP 循環(huán)列出目錄內(nèi)容的函數(shù)代碼
更新時間:2010年05月26日 01:19:26 作者:
PHP循環(huán)列出目錄內(nèi)容代碼,一個功能函數(shù)。
復(fù)制代碼 代碼如下:
function list_files($dir)
{
if(is_dir($dir))
{
if($handle = opendir($dir))
{
while(($file = readdir($handle)) !== false)
{
if($file != "." && $file != ".." && $file != "Thumbs.db")
{
echo '<a target="_blank" href="'.$dir.$file.'">'.$file.'</a><br>'."\n";
}
}
closedir($handle);
}
}
}
這里是摘自腳本之家之前發(fā)布的文章。更多的技巧可以參考。
收集的二十一個實用便利的PHP函數(shù)代碼
您可能感興趣的文章:
- PHP數(shù)組循環(huán)操作詳細介紹 附實例代碼
- PHP數(shù)組及條件,循環(huán)語句學(xué)習(xí)
- php循環(huán)語句 for()與foreach()用法區(qū)別介紹
- 幾種有用的變型 PHP中循環(huán)語句的用法介紹
- php smarty 二級分類代碼和模版循環(huán)例子
- php學(xué)習(xí)之 循環(huán)結(jié)構(gòu)實現(xiàn)代碼
- PHP中foreach循環(huán)中使用引用要注意的地方
- php for 循環(huán)語句使用方法詳細說明
- PHP foreach循環(huán)使用詳解與實例代碼
- 關(guān)于php循環(huán)跳出的問題
相關(guān)文章
php+MySql實現(xiàn)登錄系統(tǒng)與輸出瀏覽者信息功能
這篇文章主要介紹了php+MySql實現(xiàn)登錄系統(tǒng)與輸出瀏覽者信息功能 的相關(guān)資料,需要的朋友可以參考下2016-07-07利用phpexcel對數(shù)據(jù)庫數(shù)據(jù)的導(dǎo)入excel(excel篩選)、導(dǎo)出excel
本篇文章主要介紹了利用phpexcel對數(shù)據(jù)庫數(shù)據(jù)的導(dǎo)入excel(excel篩選)、導(dǎo)出excel的相關(guān)知識。具有很好的參考價值。下面跟著小編一起來看下吧2017-04-04Zend studio for eclipse中使php可以調(diào)用mysql相關(guān)函數(shù)的設(shè)置方法
默認(rèn)情況zend studio 中的php是不支持mysql 相關(guān)操作,但通過下面的方法即可解決2008-10-10