Services webmasters
Partenaires
Jeux concours gratuits
 
getservbyport
<<<
ip2long long2ip
>>>

7.66 Réseau
7 Index des fonctions
 Manuel PHP

Introduction
Pré-requis
Installation
Configuration à l'exécution
Types de ressources
Constantes prédefinies
checkdnsrr
closelog
debugger_off
debugger_on
define_syslog_variables
dns_check_record
dns_get_mx
dns_get_record
fsockopen
gethostbyaddr
gethostbyname
gethostbynamel
getmxrr
getprotobyname
getprotobynumber
getservbyname
getservbyport
->ip2long
long2ip
openlog
pfsockopen
socket_get_status
socket_set_blocking
socket_set_timeout
syslog

7.66.24 ip2long() Convertit une chaîne contenant une adresse (IPv4) IP numérique en adresse littérale.

[ Exemples avec ip2long ]   PHP 4

int  ip2long ( string   ip_address )

ip2long génère une adresse IPv4 à partir de son équivalent numérique.
Exemple ip2long

<?php
$ip
= gethostbyname("www.php.net");
$out = "Les URLS suivantes sont équivalentes :<br>\n";
$out .= "http://www.php.net/, http://".$ip."/, et http://".ip2long($ip)."/<br>\n";
echo
$out;
?>

Ce second exemple montre comment afficher une adresse convertie à l'aide de la fonction printf :
Affichage d'adresse IP

<?php
    $ip
= gethostbyname("www.php.net");
    
printf ("%u\n", ip2long ($ip));
    echo
$out;
?>

Voir aussi long2ip et sprintf .

<< ip2long >>
getservbyport Réseau long2ip
Services webmasters
Les manuels
 
CoursPHP.com - Reproduction interdite -