当前位置: 动力学知识库 > 问答 > 编程问答 >

php - Decimal to hex string

问题描述:

I have a decimal value of a utf-32 character:

$a=21644;

How can I convert this using php to a string of the hex? '548c'

Here is the page for the codes I am using:

http://www.fileformat.info/info/unicode/char/548c/index.htm

网友答案:

dechex is what you need here:

php > echo dechex(21644);
548c
网友答案:

You'll want to use dechex:

$hex = dechex($decimal);

Read more here

分享给朋友:
您可能感兴趣的文章:
随机阅读: