How To Create a Directory


How To Create a Directory? - PHP Script Tips - Working with Directoris and Files



You can use the mkdir() function to create a directory. Here is a PHP script example on how to use mkdir():

if (file_exists("/temp/download")) {
  print("Directory already exists.\n");
} else {
  print("Directory created.\n");

This script will print:

Directory created.

If you run this script again, it will print:

Directory already exists.

2007-04-23, 4665👍, 0💬