PHP

Topic: Files

How To Create a Directory?

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.

Browse random answers: