ballhogjoni Posted July 1, 2007 Share Posted July 1, 2007 This is some code I have foreach (glob("*.php") as $filename) { if (in_array($filename,$noshow)) { continue; } and I am wondering if I could tell the foreach array to look at a specific directory. Ex: foreach (glob("http://xxx/*.php") as $filename) { if (in_array($filename,$noshow)) { continue; } Link to comment https://forums.phpfreaks.com/topic/57989-can-i-direct-glob-to-a-specific-directory/ Share on other sites More sharing options...
trq Posted July 1, 2007 Share Posted July 1, 2007 I am wondering if I could tell the foreach array to look at a specific directory. Yes. However your example is a url, not a filepath. foreach (glob("/etc/*rc") as $filename) { Will work for instance, but a url will not. Link to comment https://forums.phpfreaks.com/topic/57989-can-i-direct-glob-to-a-specific-directory/#findComment-287442 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.