cooldude832 Posted May 26, 2008 Share Posted May 26, 2008 so I thought this would work but it returns only the current folder's context for pdfs (tried it with .php also same thing) <?php foreach (glob("*.pdf") as $filename) { echo "$filename size " . filesize($filename) . "\n<br />"; } ?> ?> Trying to find a pdf on a server and I have no clue where it is how can I get all folders and not just the current working one? Link to comment https://forums.phpfreaks.com/topic/107366-glob-to-find-all-pdf-files-above-_serverdocument_root/ Share on other sites More sharing options...
trq Posted May 27, 2008 Share Posted May 27, 2008 You would need to write a recursive function. If this is just a one off that your looking for and you have shell access, easier to use Linux's find command. Run from / find -name *pdf Link to comment https://forums.phpfreaks.com/topic/107366-glob-to-find-all-pdf-files-above-_serverdocument_root/#findComment-550475 Share on other sites More sharing options...
cooldude832 Posted May 27, 2008 Author Share Posted May 27, 2008 I don't have shell access and i'm spacing on how to get all the dirs with glob. Link to comment https://forums.phpfreaks.com/topic/107366-glob-to-find-all-pdf-files-above-_serverdocument_root/#findComment-550478 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.