PHP

PHP Menu

PHP

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

Definition

The md5() function calculates the MD5 hash of a string.

Syntax

md5(string, raw)

Parameters

Parameter Description
string Required. The string to be calculated.
raw Optional. Specifies hex or binary output format:
true - Raw 16 character binary format
false - Default. 32 character hex number

Example

<?php
$str = "Welcome!"; echo md5($str);

Introduction

PHP Basics

PHP Advance

PHP OOP

PHP Functions and Methods