Le module IP propose plusieurs fonctions pour traiter l'ip du client.
Il offre les fonctions suivantes:
- getip : adresse IP du client
- ip2hex : conversion d'adresse IP en format hexadécimal
- hex2ip : conversion d'adresse IP depuis un format hexadécimal
getip
Retourne l'IP de l'internaute sous la forme xxx.xxx.xxx.xxx.Exemple :
~getip() => 38.103.63.16
ip2hex
Prend un argument, une adresse IP sous la forme xxx.xxx.xxx.xxx, puis la retourne sous une forme héxadécimale, AAAAAAAA.Exemple :
~ip2hex('38.103.63.16') => 26673f10
hex2ip
Prend un argument, une adresse IP sous forme héxadécimale, puis la retourne sous la forme xxx.xxx.xxx.xxx.Exemple :
~hex2ip('26673f10') => 38.103.63.16
Télécharger
FAQ
