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, ∼3316🔥, 0💬
Popular Posts:
How to use "xsl-transform" Azure API Policy Statement? The "xsl-transform" Policy Statement allows y...
How To Remove Slashes on Submitted Input Values in PHP? By default, when input values are submitted ...
How to view API details on the Publisher Dashboard of an Azure API Management Service? You can follo...
How to install "The Windows SDK version 8.1"? I need to build my Visual Studio C++ applications. If ...
Where can I download the EPUB 2.0 sample book "The Problems of Philosophy" by Lewis Theme? You can f...