note 18989 added to function.dechex
| From: | jfren484 at hotmail dot com | Date: | Tue, 12 Feb 2002 20:47:11 +0000 |
| Subject: | note 18989 added to function.dechex | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-26519@lists.php.net to get a copy of this message | ||
Here's a function which works for decimal values up to 9007199254740992 (hex 20000000000000).
function dec2hex($dec)
{
$hex = ($dec == 0 ? '0' : '');
while ($dec > 0)
{
$hex = dechex($dec - floor($dec / 16) * 16) . $hex;
$dec = floor($dec / 16);
}
return $hex;
}
--
http://www.php.net/manual/en/function.dechex.php
http://master.php.net/manage/user-notes.php?action=edit+18989
http://master.php.net/manage/user-notes.php?action=delete+18989
http://master.php.net/manage/user-notes.php?action=reject+18989