Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialtinashegondokondo
Courses Plus Student 13,579 PointsFile Handling in PHP
I am getting the following message:
Warning: scandir(data): failed to open dir: No such file or directory in /home/treehouse/workspace/data/index.php on line 5
Warning: scandir(): (errno 2): No such file or directory in /home/treehouse/workspace/data/index.php on line 5
Warning: Invalid argument supplied for foreach() in /home/treehouse/workspace/data/index.php on line 8
My code is as below:
'; foreach ($files as $file) { if (substr($file, 0, 1) != '.') { echo '
'; if (is_dir($dir . '/' . $file)) { echo $file; readFolderFiles($dir . '/' . $file); } else { echo '' . $file . ''; } echo ' '; } } echo ''; } readFolderFiles('data');