Home > php教程 > php手册 > php如何获取文件夹名字

php如何获取文件夹名字

WBOY
Release: 2016-06-21 08:56:52
Original
2009 people have browsed it

php如何获取文件夹名字

php如何获取文件夹名字其实很简单,只要记住一两个函数就可以了!


$dir = "message/";  // 文件夹的名称

if (is_dir($dir)){
    if ($dh = opendir($dir)){
        while (($file = readdir($dh)) !== false){
            echo "文件名: $file
";
        }
        closedir($dh);
    }
}
 



Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template