(PHP 4, PHP 5)
gethostbyname — Retourne l'adresse IP correspondant à un hôte
gethostbyname() retourne l'adresse IP correspondant à l'hôte hostname ou une chaîne correspondant à hostname en cas d'erreur.
Exemple 1748. Exemple avec gethostbyname()
<?php
$ip
=
gethostbyname
(
'www.example.com'
);
echo
$ip
;
?>
gethostbyaddr() |
gethostbynamel() |