PHP obtains the file md5 and checks whether the file is modified ,. PHP obtains the md5 value of the file and checks whether the file has been modified. to determine whether the uploaded file has been modified, it is necessary to record the md5 value of the uploaded file, so here we will talk about getting the file md PHP to get the file md5 and check whether it has been modified,
To determine whether the uploaded file has been modified, you need to record the md5 value of the uploaded file. here we will talk about how to obtain the md5 value of the file.
Md5_file ()
MD5 hash of the md5_file () function compute file. The md5 () function uses RSA Data Security, including the MD5 packet excerpt algorithm. If the calculation succeeds, the calculated MD5 hash is returned. if the calculation fails, false is returned.
Syntax: md5 (string, raw)
§ String parameter, required, specifies the file to be calculated.
§ Parameter charlist, optional. The hexadecimal or binary output format is required: TRUE-original 16-character binary format; FALSE-default. 32 characters in hexadecimal notation.
MD5 hash for storing the "test.doc" file:
Now, we will check whether "test.doc" has been changed (that is, whether the MD5 hash has been changed ):
The end.
Upload, because you need to determine whether the uploaded file has been modified, you need to record the md5 value of the uploaded file, so here we will talk about getting the file md...