• PHP Video Tutorials

PHP - Function bin2hex



Syntax

string bin2hex ( string $str ) 

Definition and Usage

It is used to convert primary data to hexadecimal representation

Return Values

It returns the escaped string

Parameters

Sr.No Parameters & Description
1

str

This string to be escaped

Example

Try out the following example

<?php
   $binary = "Tutorialspoint";
   $hex = dechex(bindec($binary));
   
   echo $hex;
?>

This will produce following result −

0
php_function_reference.htm
Advertisements