Jump to content

using php 5. how to recursively read files, and get directory info for


jjk2

Recommended Posts

this link will provide every file function php has.

 

there are thousands off examples.

 

http://uk3.php.net/file

 

tel what type it is

http://uk3.php.net/manual/en/function.filetype.php

 

tell what size it is

http://uk3.php.net/manual/en/function.filesize.php

 

there so many cheek the link out.

 

 

There is opendir() which you can use to open a dir and then loop through the contents.

<?php
if ($handle = opendir("yourdirhere")) {
while (($file = readdir($handle)) !== false) {
   echo "filename: $file : filetype: " . filetype($dir . $file) . "\n";
}
closedir($dh);
}
?> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.