PHP dechex() 関数

❮ PHP Math リファレンス

10進数を16進数に変換します:

<?php
echo dechex("30") . "<br>";
echo dechex("10") . "<br>";
echo dechex("1587") . "<br>";
echo dechex("70");
?>
例の実行 »

定義と用法

dechex() 関数は、10進数を16進数に変換します。

チップ: 16進数を10進数に変換するには、hexdec() 関数を見てください。


構文

dechex(number);

パラメータ 説明
number 必須。変換する10進数を指定する

技術内容
返り値: 10進数を16進数表現した文字列を返します
返り値の型: String
PHP バージョン: 4+

❮ PHP Math リファレンス