acid.waste Posted November 3, 2010 Share Posted November 3, 2010 I am trying to use the following code to include a directories contents and was wondering what im doing wrong, because its not working? if ($handle = opendir('../configs')) { while (false !== ($FILEZ = readdir($handle))) { include "$FILEZ"; } closedir($handle); } Link to comment https://forums.phpfreaks.com/topic/217620-include-a-directorys-contents/ Share on other sites More sharing options...
MasterACE14 Posted November 3, 2010 Share Posted November 3, 2010 foreach (glob("../configs/*.php") as $filename) { include $filename; } Link to comment https://forums.phpfreaks.com/topic/217620-include-a-directorys-contents/#findComment-1129813 Share on other sites More sharing options...
acid.waste Posted November 3, 2010 Author Share Posted November 3, 2010 foreach (glob("../configs/*.php") as $filename) { include $filename; } Thank you for replying and helping! Link to comment https://forums.phpfreaks.com/topic/217620-include-a-directorys-contents/#findComment-1130055 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.