Code: Select all
<?
function str2hex ( $string )
{
for ( $i = 0; $i < strlen ( $string ) ; $i++ ) $result .= str_pad ( dechex ( ord ( $string[$i] ) ) , 2, 0, STR_PAD_LEFT ) ;
return $result;
}
echo str2hex(utf8_encode("€"));
?>
I've tried using iconv as well, but to no avail.utf8_encode() only supports iso-8859-1 to UTF-8 conversion, whilst the charset that covers euro sign is iso-8859-15. Try iconv extension instead.
Can anyone please tell me how I get from the Euro sign to "E2 82 AC"?
Many thanks.