Example analysis of mkdir function usage in php and mkdir instance analysis. Example of mkdir function usage in php, and mkdir instance Analysis This article analyzes the usage of mkdir function in php. Share it with you for your reference. The
How to create a multilevel directory using mkdir in PHP
2012-09-09 17:50:58| Category: Default categoriesfunction Mkdirs ($dir)
{
if (!is_dir ($dir))
{
if (! $this->mkdirs (dirname ($dir))) {
return false;
}
if (!mkdir ($dir, 0777)) {
return false;
}
Here is the information I collated from the Internet, will give you a detailed introduction of PHP function mkdir specific usage, I hope to have this need to help friends.
Project development is unavoidable to create folders on the server, such as
Example analysis of mkdir function usage in PHP, mkdir instance Analysis
This paper analyzes the usage of mkdir function in PHP. Share to everyone for your reference. The specific analysis is as follows:
mkdir () Syntax: bool mkdir (string
The following example shows a recursive creation of a directory using the mkdirs () implementation of the File class:/* Author by w3cschool.cc Main.java */import Java.io.file;public class Main {public static void Main (string[] args) {String
Mkdir command, mkdir
Mkdir -- create a new directory
Make directories
Command path:/bin/mkdir
Example 1:
# Mkdir/tmp/japan
Create a an subdirectory under the/tmp directory
Example 2:
# Mkdir-p/tmp/tumblr/xiaoshiping
-P is used for
In some PHP built-in functions (such as mkdir), adding @ at the front can mask the error thrown by the function, so how does the custom function do this? I tried the throw. New exception and Trigger_error cannot be added by the @ Mask: So, for
Command format:mkdir [Options] directory (option not writable)
Command function:Create an empty directory
Common options:- m Setting directory Permissions- p Recursive creation of multiple directories- v displays detailed process
PHP mkdir Create a directory can only be created at the first level of the directory, if the multilevel we need to recursively create a directory, oh, let me show you some of the function of the use of the technique.
Let's introduce the function of
PHP uses mkdir to create a multilevel directory method,
This example describes how PHP uses mkdir to create a multilevel directory. Share to everyone for your reference, as follows:
PHP uses mkdir () to create multi-level catalogs that are very
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.