Tools, FAQ, Tutorials:
Creating a Directory in PHP
How To Create a Directory in PHP?
✍: FYIcenter.com
You can use the mkdir() function to create a directory. Here is a PHP script example on how to use mkdir():
<?php if (file_exists("/temp/download")) { print("Directory already exists.\n"); } else { mkdir("/temp/download"); print("Directory created.\n"); } ?>
This script will print:
Directory created.
If you run this script again, it will print:
Directory already exists.
⇒ Removing an Empty Directory in PHP
⇐ Working with Directories and Files in PHP
2016-11-24, 2674🔥, 0💬
Popular Posts:
How to make application release build with Visual Studio 2017? If you want to make a final release b...
How To Avoid the Undefined Index Error in PHP? If you don't want your PHP page to give out errors as...
Why am I getting this "Docker failed to initialize" error? After installing the latest version of Do...
How to use "{{...}}" Liquid Codes in "set-body" Policy Statement? The "{{...}}" Liquid Codes in "set...
How To Pass Arrays By References? in PHP? Like normal variables, you can pass an array by reference ...