steepe Posted September 24, 2007 Share Posted September 24, 2007 I need a script that will go thru a particular folder and tell the contens of the document in that folder Quote Link to comment https://forums.phpfreaks.com/topic/70467-working-with-file-and-operating-system/ Share on other sites More sharing options...
wildteen88 Posted September 24, 2007 Share Posted September 24, 2007 Have a read of the documentation for the following functions: opendir readdir Over at php.net. You'll find example code there (look in the user comments at the bottom of the page too). Quote Link to comment https://forums.phpfreaks.com/topic/70467-working-with-file-and-operating-system/#findComment-354171 Share on other sites More sharing options...
steepe Posted September 25, 2007 Author Share Posted September 25, 2007 Thanks that really helped but what I ac. tually want is to store the contents of the documents in an array. Do u have any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/70467-working-with-file-and-operating-system/#findComment-354851 Share on other sites More sharing options...
trq Posted September 25, 2007 Share Posted September 25, 2007 file(). Quote Link to comment https://forums.phpfreaks.com/topic/70467-working-with-file-and-operating-system/#findComment-354858 Share on other sites More sharing options...
jaymc Posted September 25, 2007 Share Posted September 25, 2007 $opendir = opendir("."); $readdir = readdir($opendir); $files = array(); while ($file = $readdir) {$files[] = file_get_contnts($file);} print_r($files); Havnt tested, something like that though right Quote Link to comment https://forums.phpfreaks.com/topic/70467-working-with-file-and-operating-system/#findComment-354889 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.