Fonction PHP hexdec()
Exemple
Convertir hexadécimal en décimal :
<?php
echo hexdec("1e") . "<br>";
echo hexdec("a") . "<br>";
echo hexdec("11ff") . "<br>";
echo hexdec("cceeff");
?>
Définition et utilisation
La fonction hexdec() convertit un nombre hexadécimal en un nombre décimal.
Astuce : Pour convertir un décimal en hexadécimal, regardez la fonction dechex() .
Syntaxe
hexdec(hex_string);
Valeurs des paramètres
Parameter | Description |
---|---|
hex_string | Required. Specifies the hexadecimal string to convert |
Détails techniques
Valeur de retour : | La valeur décimale de hex_string |
---|---|
Type de retour : | Flottant / Entier |
Version PHP : | 4+ |
❮ Référence mathématique PHP