SommaireTelecharger la documentationChapitre suivantChapitre precedent  

  .: News :.: Edito :.: Scripts :.: Forum :.: Erreurs :.: Jobs :. 
 
Sommaire

Mathématiques

Introduction
Abs
Acos
acosh
Asin
asinh
Atan
Atan2
atanh
base_convert
BinDec
Ceil
Cos
cosh
DecBin
DecHex
DecOct
deg2rad
Exp
Floor
getrandmax
hexdec
lcg_value
Log
Log10
max
min
mt_rand
mt_srand
mt_getrandmax
number_format
OctDec
pi
pow
rad2deg
rand
round
Sin
sinh
Sqrt
srand
Tan
tanh

6.50.22 hexdec

[ Exemples avec hexdec ]   PHP 3, PHP 4 >= 4.0.0

Description

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-héxadecimal 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.


Chapitre précédentChapitre suivantAccueil nexen.net