Javatpoint Logo
Javatpoint Logo

PHP string md5_file() Function

PHP string md5_file() function is in-built important function. It is used to calculate the MD5 hash of a file. It uses the RSA Data Security. It returns the md5 hash on success, or FALSE on failure.


Parameter Description Required/Optional
File Specify the file to be calculated. Required
Raw Specify the Boolean hex or binary format.
  • TRUE - Raw 16 character binary format.
  • FALSE - It is default and 32 character hex number.

Example 1

Save it: "test.txt" file and past it "Hello PHP" string inside the file.



Example 2

We can store the MD5 hash of "test.txt" in a file:

We can test if "test.txt" has been changed (if the MD5 hash has been changed):


The file is ok.

Next TopicPHP String

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA