Manuel PHP

gethostbynamel

(PHP 4, PHP 5)

gethostbynamel — Retourne la liste d'IP correspondante à un hôte

Description

array gethostbynamel ( string $hostname )

gethostbynamel() retourne la liste d'IP correspondant à l'hôte hostname . Retourne FALSE si hostname ne peut être résolu.

Example#1 Exemple avec gethostbynamel()

  1. <?php
  2. $hotes = gethostbynamel('www.yahoo.com');  
  3. print_r($hotes);  
  4. ?> 

L'exemple ci-dessus va afficher :

Array ( [0] => 216.109.125.67 [1] => 64.58.76.228 [2] => 216.109.125.65 [3] => 216.109.125.70 [4] => 64.58.76.226 [5] => 64.58.76.230 [6] => 64.58.76.222 [7] => 216.109.125.66 )

Voir aussi


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