(PHP 4, PHP 5, PHP 7)
dechex — 十锟斤拷锟斤拷转锟斤拷为十锟斤拷锟斤拷锟斤拷
$number
) : string
锟斤拷锟斤拷一锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟叫革拷锟斤拷
number
锟斤拷锟斤拷锟斤拷十锟斤拷锟斤拷锟狡憋拷示锟斤拷
锟斤拷锟斤拷转锟斤拷锟斤拷锟斤拷锟斤拷锟街滴拷锟斤拷频锟�
PHP_INT_MAX
* 2 + 1 (锟斤拷
-1)锟斤拷锟斤拷 32 位平台锟斤拷锟斤拷十锟斤拷锟狡碉拷 4294967295锟斤拷锟斤拷 dechex() 锟侥斤拷锟轿� ffffffff锟斤拷
number
要转锟斤拷锟斤拷十锟斤拷锟斤拷值
PHP 锟斤拷 integer 锟斤拷锟斤拷锟斤拷锟叫凤拷锟脚的o拷锟斤拷 dechex() 锟斤拷锟斤拷锟睫凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟睫凤拷锟脚达拷锟斤拷
number
锟斤拷16锟斤拷锟狡憋拷示
Example #1 dechex() 锟斤拷锟斤拷
<?php
echo dechex(10) . "\n";
echo dechex(47);
?>
锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�
a 2f
Example #2 锟斤拷锟斤拷锟斤拷锟斤拷 dechex() 锟斤拷锟斤拷
<?php
// The output below assumes a 32-bit platform.
// Note that the output is the same for all values.
echo dechex(-1)."\n";
echo dechex(PHP_INT_MAX * 2 + 1)."\n";
echo dechex(pow(2, 32) - 1)."\n";
?>
锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�
ffffffff ffffffff ffffffff