Faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 2 people (100%) answered Yes
Recently 2 of 2 people (100%) answered Yes

Entry

What function would you open a directory for reading?

Mar 22nd, 2008 21:20
ha mo, Chad Currie, Himanshu Jain, http://www.blogvoid.com/


The opendir()function enables you to open a directory for reading.
example:
<?php
$handle=opendir("/home/yourdomain/public_html");
while ($file = readdir($handle)) {
echo $file;
}
?>
The above snippet would open the 
directory /home/yourdomain/public_html and echo the files/folders on 
the screen.
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.yamot.com
http://www.mozmar.com
http://www.templatestemp.com