Home > php教程 > php手册 > php遍历目录代码

php遍历目录代码

WBOY
Release: 2016-06-06 19:37:57
Original
1059 people have browsed it

无详细内容 无 ?php/* * dir */ if ($handle = opendir( 'D:/nginx-1.6.2/html/testphp')){ echo "Directory handle: $handle br/" ; echo "Files: br/" ; /* 遍历目录 */ while ( false !== ( $file = readdir( $handle ))){ echo " $file br/" ; } closedir

<?php
/*
 * dir
 */
 
if ($handle  =  opendir( &#39;D:/nginx-1.6.2/html/testphp&#39;)){
    echo  "Directory handle:  $handle <br/>" ;
    echo  "Files: <br/>" ;
    
     /* 遍历目录 */
     while ( false  !== ( $file  =  readdir( $handle ))){
        echo  " $file <br/>" ;
    }
     closedir( $handle );
} else {
    echo  "Directory opened false" ;
}


?>
Copy after login
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