jjk2 Posted March 29, 2009 Share Posted March 29, 2009 yes i am using php 5. how to recursively read files, and get directory info for the folder with the file ? Link to comment https://forums.phpfreaks.com/topic/151588-using-php-5-how-to-recursively-read-files-and-get-directory-info-for/ Share on other sites More sharing options...
redarrow Posted March 29, 2009 Share Posted March 29, 2009 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. Link to comment https://forums.phpfreaks.com/topic/151588-using-php-5-how-to-recursively-read-files-and-get-directory-info-for/#findComment-796142 Share on other sites More sharing options...
jjk2 Posted March 29, 2009 Author Share Posted March 29, 2009 of course i looked at php.net however i was told php 5 had some easier way. Link to comment https://forums.phpfreaks.com/topic/151588-using-php-5-how-to-recursively-read-files-and-get-directory-info-for/#findComment-796157 Share on other sites More sharing options...
redarrow Posted March 29, 2009 Share Posted March 29, 2009 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); } ?> Link to comment https://forums.phpfreaks.com/topic/151588-using-php-5-how-to-recursively-read-files-and-get-directory-info-for/#findComment-796159 Share on other sites More sharing options...
jjk2 Posted March 29, 2009 Author Share Posted March 29, 2009 thanks @ redarrow, that script is not working. Link to comment https://forums.phpfreaks.com/topic/151588-using-php-5-how-to-recursively-read-files-and-get-directory-info-for/#findComment-796323 Share on other sites More sharing options...
jjk2 Posted March 29, 2009 Author Share Posted March 29, 2009 bump bump Link to comment https://forums.phpfreaks.com/topic/151588-using-php-5-how-to-recursively-read-files-and-get-directory-info-for/#findComment-796421 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.