Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17182 программиста и 1834 робота. Сейчас ищут 1680 программистов ...
Net_Whois::query()
Вернуться к: Net_Whois
Net_Whois::query()
Net_Whois::query() – does a whois query
Synopsis
require_once 'Net/Whois.php';
string Net_Whois::query ( string $query , string $server )
Executes a Whois query on a server
Parameter
-
string $query - the Whois database object to look up
-
string $server - the name of the server or its IP address
Return value
string - the data from the Whois request.
Throws
Error code | Error message | Reason | Solution |
---|---|---|---|
every | " Error connecting to server (Net_Socket says: Error-Message.) " | Connection to server failed | Check typing of server address and make sure the host is connected to the network. |
You will not get a PEAR_Error, if the query fails due to a not existing whois object. This can be only done by checking the data returned by query().
Example
Using Whois-query()
<?php
require_once "Net/Whois.php";
$server = "whois.denic.de";
$query = "phpcrawler.de"; // get information about
// this domain
$whois = new Net_Whois;
$data = $whois->query($query, $server);
echo $data;
?>
Вернуться к: Net_Whois