PHP Create a multi-level directory method, PHP create _php Tutorial

Source: Internet
Author: User

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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.