Manuel PHP

gethostbyname

(PHP 4, PHP 5)

gethostbyname — Retourne l'adresse IP correspondant à un hôte

Description

string gethostbyname ( string $hostname )

gethostbyname() retourne l'adresse IP correspondant à l'hôte hostname ou une chaîne correspondant à hostname en cas d'erreur.

Example#1 Exemple avec gethostbyname()

  1. <?php
  2. $ip = gethostbyname('www.example.com');  
  3.  
  4. echo $ip;  
  5. ?> 


Remonter Remonter
L'éditeur javascript - CSS - Gentoo - Tutoriaux PHP - Tutoriels PHP - Breizh Blog