← All built-ins / bin2hex()

bin2hex()

bin2hex(string $s): string

Parameters

NameTypeDescription
$sstringraw bytes

Return value

Hex string, two characters per byte.

Example

echo bin2hex("AB");
4142

See also

hex2bin()sha256()md5()