PHP - การอ่าน Directory

Written by admin    Sunday, 22 August 2010 15:10

 ตัวอย่าง โค้ด โปรแกรมภาษา PHP การอ่าน Directory  โดยคำสั่ง opendir


Code:


<?

 

$dir = opendir("C:/AppServ/www");

while (($data = readdir($dir)) !== false) {

echo "$data<br>\n";

}

 

closedir($dir);

 

?>

 



 

ผลลัพธ์

.

..

appserv

cgi-bin

index.php

phpinfo.php

phpMyAdmin

 

 

 


 

 

อ้างอิง :

1. เรียนลัด PHP 4 (สมประสงค์ ธิตินิลนิธิ)

2. www.php.net

 

 

Add comment


Security code
Refresh

Joomla template modify by Ban-Goi.com