i want to convert string into hexdecimal value..
Like
'Hi'
into
00680069
<?php
function ascii2hex($ascii) {
$hex = '';
for ($i = 0; $i < strlen($ascii); $i++) {
$byte = strtoupper(dechex(ord($ascii{$i})));
$byte = str_repeat('0', 2 - strlen($byte)).$byte;
$hex.=$byte." ";
}
return $hex;
}
//echo ascii2hex('he');
echo dechex(ord('hello'));
?>
I got this function which convert it but works only for enlish char.
not for non english char like arabic...
Can anybody help me.? :O