Home >Backend Development >PHP Tutorial >10 recommended articles about php mkdir() function
In some PHP built-in functions (such as mkdir), adding @ in front can shield the errors thrown by the function So how do custom functions achieve this? I tried throw new Exception and trigger_error but they couldn't be blocked by @ Additional instructions: It's like this. For example, I want to write a JsonFile::get() method that throws an error when the file does not exist, throws an error when the path is illegal, throws an error when decoding fails, and returns false. When the user cares about the error message, he can catch and handle it by himself; when he doesn't care about the error message and just wants to get the file content or false (failure), he can call @JsonFile::get() like this Mainly for convenience. How to implement such a custom method (or function)? Or is my way of thinking not very good? Is there a convenient and reasonable implementation method? 1. How to prevent the custom function in PHP from throwing an error when containing @? Introduction: In some PHP built-in functions (such as mkdir), adding @ in front can shield the errors thrown by the function. So since
1. How to use GET()? Summary of php GET() instance usage
##Introduction: In some PHP built-in functions (such as mkdir), Adding @ in front can shield the errors thrown by the function. So how can the custom function achieve this? I tried throw new Exception and trigger_error and they couldn't be blocked by @. Additional explanation: It's like this. For example, I want to write a JsonFile::get() method that throws an error when the file does not exist and throws an error when the path is illegal. When decoding fails, an error is thrown and false is returned. When the user cares about the error message, he or she can catch it by himself...
2. 10 recommended articles about the php trigger_error() function
Introduction: In some PHP built-in functions (such as mkdir), adding @ in front can block the Errors thrown by functions So how do custom functions achieve this? I tried throw new Exception and trigger_error and they couldn't be blocked by @. Additional explanation: It's like this. For example, I want to write a JsonFile::get() method that throws an error when the file does not exist and throws an error when the path is illegal. When decoding fails, an error is thrown and false is returned. When the user cares about the error message, he or she can capture and handle it by themselves;...
3. Articles about the php chroot() function Recommended 10 articles
Introduction: This article focuses on configuration records, and the benefits of chroot (jail) will not be repeated. This article is divided into three parts: configuring basic chroot jail, configuring chroot jail for nginx, and configuring chrootjail for tomcat. 1. Configure a basic chroot jail1.1. Create a directory as the root directory of the chroot jail. # mkdir /home/chroot/jail1.2. Use the ldd command to find out the command you want to run in the chroot jail...
4. PHP upload pictures , Simple example of deleting pictures
Introduction: Simple PHP upload pictures, delete pictures implementation code to upload pictures: if (!empty($_FILES["img"]["name"])) { //Extract the file domain content name and determine $path="uppic/"; //Upload path if(!file_exists($path)) { //Check whether the folder exists, if not, create it and give it the highest permission mkdir(“$path”, 0700); }//END IF //Allow access
5. Java Example - Recursively Create Directory
Introduction: The following example demonstrates the use of the File class mkdirs() implements recursive directory creation:
6. Usage of using mkdir command to create directories and subdirectories under Linux
Introduction: This article mainly introduces the use of mkdir command to create directories and subdirectories under Linux. It has certain reference value. If you need it, you can learn about it.
7. Detailed explanation of the use of mkdir command in Linux
Introduction: This article mainly introduces in detail the use of mkdir command in Linux and the sharing of example code. It is very comprehensive and can be referenced by friends in need.
8. The difference between the mkdir function in Linux and the _mkdir function in Windows
Introduction: This article mainly introduces relevant information on the difference between the mkdir function in Linux and the _mkdir function in Windows. Friends in need can refer to it
9. php function mkdir implements recursive creation of hierarchical directories
Introduction: When we want to When adding multi-level directories to your own site, you can use the PHP function mkdir() to achieve this function. It has certain reference value, and interested friends can refer to it.
10. php uses mkdir to create a multi-level directory entry example
Introduction: This article mainly introduces the introductory example of using mkdir to create a multi-level directory in PHP. Friends who need it can refer to
[Related Q&A recommendations]:
opencv2 - Import error in python when installing opencv under mac
python3.x - Make error message for help when installing python3.5.2
php - How to use brew to install the pecl expansion package in OS X?
The above is the detailed content of 10 recommended articles about php mkdir() function. For more information, please follow other related articles on the PHP Chinese website!