- unlink() function usage example
-
-
//Use unlink Function to delete files
- $filename="data.txt"; //Define variables
- unlink($filename); //Use the unlink function to delete files. The filename here should be a relative address, which means that the file in the current web page directory will be deleted. data.txt is deleted. Returns TRUE on success, FALSE on failure.
- //When I just used the unlink function on the server today, I reported an error when using a relative address. The file could not be found, so I changed it to an absolute address and deleted it! The local machine is window and the server is lunix. For the time being, the relative address is used under window and the absolute address is used under lunix!
Copy code
- mkdir() function Example title>
-
- //Use the mkdir function to create a directory
- $dirname="mydir"; //Define variables
- mkdir($dirname,0700); //Use mkdir To create a directory, the directory here is also relative. Create a directory named "mydir" under the directory of this web page! Returns TRUE on success, FALSE on failure.
- //When I just used the unlink function on the server today, I reported an error when using a relative address. The file could not be found, so I changed it to an absolute address and deleted it! The local machine is window and the server is lunix. For the time being, use relative addresses under window and absolute addresses under lunix!
- ?>
|