php convert string to hexadecimal code example Example: php convert char to hex <?php $str = bin2hex("Hello World"); echo($str); ?>