PHP BIN2HEX Converts binary data into hexadecimal representation
Php bin2hex () function as the name implies stands for Binary to Hexadecimal
PHP bin2hex stands for Binary to Hexadecimal.
USAGE OF PHP BIN2HEX
PHP BIN2HEX returns the hexadecimal representation of the given string.
SYNTAX OF PHP BIN2HEX
bin2hex ($string
)
PHP BIN2HEX TECHNICAL FEATURES
PHP BIN2HEX function is supported in (PHP 4, PHP 5, PHP 7)
DESCRIPTION OF PHP BIN2HEX
As the name implies Php Bin2Hex converts string as binary to hexadecimal
PARAMETERS / PROPERTIES OF PHP BIN2HEX
$string | The string to be escaped. |
EXAMPLE(S) OF PHP BIN2HEX #1
<?php echo bin2hex("Shopinson's Blog")."<br>"; //Output "53686f70696e736f6e277320426c6f67" echo bin2hex("It's me Godwin")."<br>"; //Output "49742773206d6520476f6477696e" echo bin2hex("I'm really making it");//Output "49276d207265616c6c79206d616b696e67206974" ?>
This example will output the result below
53686f70696e736f6e277320426c6f67
49742773206d6520476f6477696e
49276d207265616c6c79206d616b696e67206974
EXAMPLE(S) OF PHP BIN2HEX #2
<?php $binary = "11111001"; echo bin2hex($binary); //output "3131313131303031" ?>
This example will output “3131313131303031
”