Created
September 24, 2013 10:06
-
-
Save lionhylra/6682748 to your computer and use it in GitHub Desktop.
遍历目录文件
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if($handle = opendir('C:\\Inetpub\\wwwroot\\test\\')){ | |
echo "Files:\n"; | |
while (false !== ($file = readdir($handle))){ | |
echo "$file\n"; | |
} | |
closedir($handle); | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach(glob('*.*') as $filename){ | |
echo 'Filename:'.$filename; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment