Services webmasters
Partenaires
Jeux concours gratuits
 
getrandmax
<<<
hexdec hypot
>>>

7.50 Mathématiques
7 Index des fonctions
 Manuel PHP

Introduction
Pré-requis
Installation
Configuration à l'exécution
Types de ressources
Constantes prédefinies
abs
acos
acosh
asin
asinh
atan
atan2
atanh
base_convert
bindec
ceil
cos
cosh
decbin
dechex
decoct
deg2rad
exp
expm1
floor
fmod
getrandmax
->hexdec
hypot
is_finite
is_infinite
is_nan
lcg_value
log
log10
log1p
max
min
mt_getrandmax
mt_rand
mt_srand
octdec
pi
pow
rad2deg
rand
round
sin
sinh
sqrt
srand
tan
tanh

7.50.29 hexdec()Convertit de hexadécimal en décimal

[ Exemples avec hexdec ]   PHP 3, PHP 4

int  hexdec ( string   hex_string )

hexdec retourne une chaîne contenant la représentation décimale du nombre hex_string . Le nombre le plus grand qui puisse être converti est 7fffffff en décimal, ce qui donne "2147483647".

hexdec remplace tous les caractères non-hexadécimaux par des 0 . Et si les zéros de gauche sont ignorés, ceux de droite prennent le propre valeur.
Exemple avec hexdec

<?php
  var_dump
(hexdec("Hop comme ceci"));
  
var_dump(hexdec("0000c000e0cec0"));
  
var_dump(hexdec("c000e0cec0"));
// les deux affichent "int(14732992)"
  
var_dump(hexdec("aussi"));
  
var_dump(hexdec("a0000"));
// les deux affichent "int(655360)"
?>

Voir aussi dechex .

<< hexdec >>
getrandmax Mathématiques hypot
Services webmasters
Les manuels
 
CoursPHP.com - Reproduction interdite -