PHP: Make or Create A Directory

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

1 thought on “PHP: Make or Create A Directory”

  1. Pingback: PHP: Change Current Working Directory

Comments are closed.

Scroll to Top