PHP-dechex():10進数を16進数に変換
PHP関数
dechex
サマリ
10進数を16進数に変換します.
関数プロトタイプ
PHPのintタイプは符号を有するが、
説明:
PHP 4バージョンから提供されます.
指定された符号なし
変換可能な最大数は
32ビットプラットフォームでは、10進数4294967295
例1
https://phpman.ml/dechex
https://www.php.net/manual/en/function.dechex.php
Pythonコード
hexdec
decbin
decoct
base_convert
copyright phpman all right reserved
インスタントレコーダ uses phpman 's content under contract.
インスタントレコーダで開発依頼を要求する場合は、FAQを参照してください.適切であれば、[email protected]に連絡してください.
dechex
サマリ
10進数を16進数に変換します.
関数プロトタイプ
dechex ( int $num ) : string
パラメータ$num
変換する10進数.PHPのintタイプは符号を有するが、
dechex()
は符号なし整数を扱うので、負の整数は符号なしとみなす.説明:
PHP 4バージョンから提供されます.
指定された符号なし
$num
引数の16進数表現を含む文字列を返します.変換可能な最大数は
PHP_INT_MAX * 2 + 1 (또는 -1)
です.32ビットプラットフォームでは、10進数4294967295
dechex()
はffffffff
を返します.例1
echo dechex(10) . "\n";
echo dechex(47);
結果.a
2f
例2// 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
リファレンスhttps://phpman.ml/dechex
https://www.php.net/manual/en/function.dechex.php
Pythonコード
def dechex(number):
return hex(number)
そうかんかんすうhexdec
decbin
decoct
base_convert
copyright phpman all right reserved
インスタントレコーダ uses phpman 's content under contract.
インスタントレコーダで開発依頼を要求する場合は、FAQを参照してください.適切であれば、[email protected]に連絡してください.
Reference
この問題について(PHP-dechex():10進数を16進数に変換), 我々は、より多くの情報をここで見つけました https://velog.io/@instantcoderweb/PHP-dechex-10-진수를-16-진수로-변환합니다テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol