I want to access a folder from a .php file using scandir();
!
This is my folder tree:
- public_html:
- lua:
- fld1:
- myfile.php
- works(folder)
The "fld1" directory contains the php file and the "works" folder(the requested one)
The php file and the folder are in the same location!
I tried to access it like this:
<?php
$dir = "works/";
// Sort in ascending order - this is default
$a = scandir($dir);
// Sort in descending order
$b = scandir($dir,1);
print_r($a);
?>
But nothing is printed on the page!
I also tried this:
$dir = "/works/";
or the full path:
$dir = "/public_html/lua/fld1/works/";