The function in PHP that’s used to create a directory is just the same with that in Linux bash shell: mkdir.
First make sure the current working directory is where you want the new directory to be, then run this line of PHP:
mkdir('new_dir'); // creates a new directory named new_dir under the current directory
You should also read:
- PHP: Change Current Working Directory
- Linux: Change Directory or CD to the Previous Directory / Last Path
- PHP: Why you should use dirname(__FILE__).‘/include.php’ instead of just ‘include.php’
- Linux wget Command to Download and Mirror a Website in Static Local Copy
- Linux: Check how much disk storage each directory takes up (Disk Usage command – du)


Facebook
Twitter
Google Plus
{ 1 trackback }