PHP Create a multi-level directory method, PHP create
This example describes how PHP creates a multilevel directory. Share to everyone for your reference. The implementation method is as follows:
<?php/* Write a PHP function that can create a multilevel directory */function createdirlist ($path, $mode) { if (Is_dir ($path)) { //To determine if the directory exists no, there is no creation echo "directory". $path. "' already exists"; The input path already exists }else{//does not exist create directory $re =mkdir ($path, $mode, true); The third argument is true to create a multi-polar directory if ($re) { echo "directory creation succeeded";//Directory creation succeeded }else{ echo "Directory creation failed"; }}} $path = "/A/X/CC/CD"; The directory to be created $mode=0755; Create a schema for the directory, that is, permissions. Createdirlist ($path, $mode);//test
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/972626.html www.bkjia.com true http://www.bkjia.com/PHPjc/972626.html techarticle PHP creates a multi-level directory approach, PHP creates an example of this article that explains how PHP creates a multilevel directory. Share to everyone for your reference. The concrete implementation method is as follows: PHP/* Write a can create ...