Which function is used by php to delete a picture?
The main content of this article is to explain "which is the function of php to delete pictures". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "which is the function of php to delete pictures"!
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
Pictures are also a file type, and if you want to delete image files, you can use the PHP unlink () function.
The unlink () function can delete the specified file. It returns TRUE on success and FALSE on failure. The syntax format is as follows:
Unlink (string $filename [, resource $context])
Where $filename is the file path to be deleted, and $context is an optional parameter that specifies the environment of the file handle. Ontext is a set of options that can modify the behavior of the flow.
Example: delete the 1.png file in the img directory
Output result:
At this point, I believe that everyone on the "php delete picture function is which" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!