Unlink () function deletes file, mkdir () function creates directory, RmDir () function deletes directory
Copy Code code as follows:
<title>unlink () function Use example </title>
<body>
?
To delete a file using the Unlink function
$filename = "Data.txt"; Defining variables
Unlink ($filename); Delete the file with the unlink function, where filename should be the relative address, that is, delete the data.txt from the current page directory. Returns TRUE if successful, and returns FALSE if it fails.
Today just on the server using the unlink function, with the relative address of the error, can not find the file, and then changed to absolute address, deleted! This machine is window and the server is LUnix. Temporarily is the window under the relative address, LUnix under the absolute address! Everyone used to see if this is the case, and then help confirm!
</body>
<title>mkdir () function Use example </title>
<body>
?
Create a table of contents using the MkDir function
$dirname = "Mydir"; Defining variables
mkdir ($dirname, 0700); Use mkdir to create a directory, where the directory is also relative to the page in the directory to create a directory called "Mydir"! Returns TRUE if successful, and returns FALSE if it fails.
Today just on the server using the unlink function, with the relative address of the error, can not find the file, and then changed to absolute address, deleted! This machine is window and the server is LUnix. Temporarily is the window under the relative address, LUnix under the absolute address! Everyone used to see if this is the case, and then help confirm!
?>
</body>
<title>rmdir () function Use example </title>
<body>
?
To delete a directory using the RmDir function
$dirname = "Mydir"; Defining variables
RmDir ($dirname); Use RmDir to delete the directory, where the directory is also relative to this page in the directory of a directory named "Mydir" Delete! Returns TRUE if successful, and returns FALSE if it fails.
Today just on the server using the unlink function, with the relative address of the error, can not find the file, and then changed to absolute address, deleted! This machine is window and the server is LUnix. Temporarily is the window under the relative address, LUnix under the absolute address! Everyone used to see if this is the case, and then help confirm!
?>
</body>
Oh, simple application! The system is always to upload pictures, documents and so on, the background management inside are deleted records, and do not delete the actual uploaded image files. Now the server is very bloated, the original deletion of the specified file is not difficult, on the unlink function is good!