php 함수

opendir()

파일이름 가져오는것은 일정한 순서가 있는것이 아니다.

 

[root@linuxtip ~]# cat opendir.php
<?
        $dirhandle = opendir("/usr/local/apache/htdocs/");

        while($filename = readdir($dirhandle)) {
                echo $filename."\n";
        }
        closedir($dirhandle);
?>
[root@linuxtip ~]# php opendir.php
index.html.es
index.html.cz
index.html.nn
index.html.ca
index.html
index.html.zh-tw.big5
index.html.en
index.html.no
index.html.it
index.html.lb.utf8
license.txt
index.html.ru.ucs4
index.html.ru.iso-ru
..
index.html.ru.cp866
index.html.pt-br
index.html.he.iso8859-8
index.html.ee
index.html.ru.utf8
xspf
.
apache_pb.gif
index.html.ru.koi8-r
index.html.fr
index.html.el
index.html.ru.ucs2
index.html.ru.cp-1251
index.html.ja.jis
index.html.hu
phpmp3
index.html.po.iso-pl
index.html.se
index.html.kr.iso-kr
index.html.pt
index.html.de
phpmptest
index.html.nl
manual
index.html.dk

 

댓글

댓글 본문
작성자
비밀번호
graphittie 자세히 보기