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, ∼3923🔥, 0💬
Popular Posts:
How to use "xsl-transform" Azure API Policy Statement? The "xsl-transform" Policy Statement allows y...
How to use the urllib.request.Request object to build more complex HTTP request? The urllib.request....
Why I am getting "The Windows SDK version 8.1 was not found" error, when building my C++ application...
How to create a VC# class and build it into a library? If you want to create a VC# class and build i...
How to use the built-in "context" object in Policy expressions? The built-in "context" object can be...