Hi
I think I'd better show what the sturcture is of my folder.
The index.php file I am working on is in /admin
The files and folders I would like to create are in / (root).
I made a test index.php in root (/index.php) and I have commented out how I thought the system worked:
$hide= array('.','..','admin'); /* Array of things to hide */
$files_and_directories = scandir($folder_path); /* Opens $folder_path and puts contents into array */
$unhidden = array_diff($files_and_directories, $hide); /* Shows the files and folders that are not in the $hide array */
$files = array_filter($unhidden, 'is_file'); /* Filters all the $unhidden array variables into ones that are files */
$directories = array_diff($unhidden, $files); /* Filters all the $unhidden array variables into ones that are not in the $files array */
echo "Files and directories: ";
print_r($files_and_directories);
echo "<br /><br />";
echo "Unhidden: ";
print_r($unhidden);
echo "<br /><br />";
echo "Files: ";
print_r($files);
echo "<br /><br />";
echo "Directories: ";
print_r($directories);
print_r($directories);
makes: Array ( [3] => test.php )
And
print_r($files);
makes: Array ( )
Is the is_file not working? Should I use is_dir somewhere?
Thanks for your help