Convert TEXT2HEX

Here is a php script snippet to convert string text to hex decimal code.
PHP CODE

function text2hex($string) {
$hex = '';
$len =
strlen($string) ;
for ($i = 0; $i < $len; $i++) {
$hex .=
str_pad(dechex(ord($string[$i])), 2, 0, STR_PAD_LEFT);
}
return $hex;
}

No comments: