Quick Search:
 
 PHP Code: Find IP from Hostname Jump to:  
Category: >> PHP Code >> Find IP from Hostname  

<< lastnext >>

Snippet Name: Find IP from Hostname

Description: This often works better than using gethostbyname() or other native functions:

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: February 27th, 2009

<?PHP
 
$ip = RTRIM(`/usr/bin/dig $host A +short | /usr/bin/tail -1`);
 
?>


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org