PHP - Domain Tools Class This is a domain class I wrote today which has the functions of:
PHP - Domain Tools Class
6
PHP - Domain Tools Class
This is a domain class I wrote today which has the functions of:
GetRegistrar
GetWhoisServer
GetUpdatedDate
GetCreationDate
GetExpirationDate
It's easy to read, learn, and use.
I used file_get_contents rather than curl as curl is not enabled on all hosts, but a majority of them and plus I would of only used curl if I had wanted to increase speed, and flexibility.
PHP Source:
Original Thread, and for updates -> http://www.coderzspot.com/index.php?...n-tools-class/
This is a domain class I wrote today which has the functions of:
GetRegistrar
GetWhoisServer
GetUpdatedDate
GetCreationDate
GetExpirationDate
It's easy to read, learn, and use.
I used file_get_contents rather than curl as curl is not enabled on all hosts, but a majority of them and plus I would of only used curl if I had wanted to increase speed, and flexibility.
PHP Source:
Code:
<?php
/**
* @author Vick@CoderzSpot.com
* @website www.CoderzSpot.com
* @version 1.0
* @date(25-10-2011)
* @contact vick@hotmail.com.au
**/
class Domain{
function GetRegistrar($url)
{
$output = file_get_contents("http://new.whois.net/whois/$url");
$regex = '/Registrar: (.+?) Whois/';
preg_match($regex, $output, $match);
echo "Registrar: ".$match[1];
}
function GetWhoisServer($url)
{
$output = file_get_contents("http://new.whois.net/whois/$url");
$regex = '/Whois Server: (.+?) Referral/';
preg_match($regex, $output, $match);
echo "Whois Server: ".$match[1];
}
function GetUpdatedDate($url)
{
$output = file_get_contents("http://new.whois.net/whois/$url");
$regex = '/Updated Date: (.+?) Creation/';
preg_match($regex, $output, $match);
echo "Updated Date: ".$match[1];
}
function GetCreationDate($url)
{
$output = file_get_contents("http://new.whois.net/whois/$url");
$regex = '/Creation Date: (.+?) Expiration/';
preg_match($regex, $output, $match);
echo "Creation Date: ".$match[1];
}
function GetExpirationDate($url)
{
$output = file_get_contents("http://new.whois.net/whois/$url");
$regex = '/Expiration Date: (.+?) /';
preg_match($regex, $output, $match);
$substr = substr($match[1], 0, -11);
echo "Expiration Date: ".$substr;
}
}
$domain = new Domain();
$domain->GetRegistrar("coderzspot.com");
$domain->GetWhoisServer("coderzspot.com");
$domain->GetUpdatedDate("coderzspot.com");
$domain->GetCreationDate("coderzspot.com");
$domain->GetExpirationDate("coderzspot.com");
?> - Tim Brownlaw
- mmstud
- pfreelancer
- wasabi20
- [1] reply
- megazord100
Next Topics on Trending Feed
-
6