Snippets tagged “scandir”
4 snippets use this tag.
- Getting the names of all files in a directory with PHPPHP
In PHP, you can use the scandir() function to get the names of all files in a directory.
- How can I use PHP to check if a directory is empty?PHP
You can use the scandir() function to get an array of files in a directory, and then check the length of the array.
- How do I recursively delete a directory and its entire contents (files + sub dirs) in PHP?PHP
In PHP, you can use the rmdir() function to remove a directory, and the unlink() function to remove a file.
- How to list files and folder in a dir (PHP)PHP
In PHP, you can use the scandir() function to list the files and directories in a directory.