PHP

PHP Menu

PHP

md5_file() Function - Definition, Syntax, Parameters, Examples

Definition

The md5_file() function calculates the MD5 hash of a file.

Syntax

md5_file(file, raw)

Parameters

Parameter Description
file Required. The file to be calculated.
raw Optional. A boolean value that specifies hex or binary output format:
true - Raw 16 character binary format
false - Default. 32 character hex number

Example

<?php

$f = "sample.txt";
$md5file = md5_file($f);
echo $md5file;

Introduction

PHP Basics

PHP Advance

PHP OOP

PHP Functions and Methods