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, 1833👍, 0💬
Popular Posts:
How To Control Vertical Alignment? By default, text in all table cells are aligned to the top vertic...
What is Azure API Management Developer Portal? Azure API Management Developer Portal is an Azure Web...
Where to see some Examples of Invalid JSON Values? Here are some Examples of Invalid JSON Values: 1....
What properties and functions are supported on http.client.HTTPResponse objects? If you get an http....
How to use the API operation 2017 version setting "Rewrite URL template"? The API operation setting ...