Location: PHPKode > scripts > domain > domain/doc_domain.txt
============================================================
		Documentation :: domain.class.php
		Copyright     :: Sven Wagener
		Contact       :: hide@address.com
		Version       :: 1.1
============================================================


Content
=======
1. About Domain Class

2. Function reference

2.1 domain() :: constructor
2.2 info() :: whois information
2.3 html_info() :: whois information - html formated
2.4 is_available() :: the availability of a domain
2.5 get_whois_server() :: the whois server of the domain
2.6 get_tld() :: the tld of the domain
2.7 get_domain :: the domain name without tld
2.8 get_fulldomain() :: the domain name
2.9 is_valid() :: validation of a domain name
2.10 get_tlds() :: all supported top level domains

3. License information



1. About Domain Class
=====================

This class provides informations about internet domains and
their registrars. It can give you the WHOIS informations or
tells if a domain is available for registration or not.
Some more functions gives back further informations about
the domain.


2. Function reference
=====================


2.1 domain() :: constructor
===========================

Use this function to initialize the class with your domain.

<example />

include("domain.class.php");
$my_domain=new domain("the-domain-to-check.com");

</ example>



2.2 info() :: whois information
===============================

The info() function returns the pure whois information from
the correct whois server without striping any information.


<example />

include("domain.class.php");

// Initializing domain class
$my_domain=new domain("the-domain-to-check.com");

// printing out whois information
echo $my_domain->info();

</ example>



2.3 html_info() :: whois information - html formated
====================================================

Identical to the info() function, but code will be returned
as html code with <br \> for new lines.


<example />

include("domain.class.php");

// Initializing domain class
$my_domain=new domain("the-domain-to-check.com");

// printing out whois information
echo $my_domain->html_info();

</ example>


2.4 is_available() :: the availability of a domain
==================================================

Checks if a domain is available for registration or not.


<example />

include("domain.class.php");

// Initializing domain class
$my_domain=new domain("the-domain-to-check.com");

// Checking availability
if($my_domain->is_available()==true){
   echo "Domain is not registered yet";
}else{
   echo "Domain is already registered";
}

</ example>


2.5 get_whois_server() :: the whois server of the domain
========================================================

Returns the whois server of the set domain.


<example />

include("domain.class.php");

// Initializing domain class
$my_domain=new domain("the-domain-to-check.com");

// Return the actual whois server of the domain
echo $my_domain->get_whois_server();

</ example>


2.6 get_tld() :: the tld of the domain
======================================

This function returns the "suffix" of the domain.
For example the domain "my-domain.cc" will return "cc".


<example />

include("domain.class.php");

// Initializing domain class
$my_domain=new domain("the-domain-to-check.com");

// Returning the tld of the domain
echo $my_domain->get_tld(); // Will return "com"

</ example>


2.7 get_domain :: the domain name without tld
=============================================

Returns the domain name without tld.


<example />

include("domain.class.php");

// Initializing domain class
$my_domain=new domain("the-domain-to-check.com");

// Returning the domain without tld
echo $my_domain->get_domain(); // Will return "the-domain-to-check"

</ example>



2.8 get_fulldomain() :: the domain name
=======================================

Returns the full domain name.


<example />

include("domain.class.php");

// Initializing domain class
$my_domain=new domain("the-domain-to-check.com");

// Returning the full domain name
echo $my_domain->get_fulldomain(); // Will return "the-domain-to-check.com"

</ example>



2.9 is_valid() :: validation of a domain name
=============================================

This function checks if a domain name is valid or not

<example />

include("domain.class.php");

// Initializing domain class
$my_domain=new domain("the-domain-to-check.com");

// Is domain valid or not

if($my_domain->is_valid()==true){
	echo "Domain name is valid";
}else{
	echo "Domain name is not valid";
}

</ example>

!Attention:

If you want to have the full IDN support, you cant use
this function to check it. Only several of the IDN chars
will be supported yet.



2.10 get_tlds() :: all supported top level domains
=================================================

This function returs all supported top level domains in an array.

<example />

include("domain.class.php");

// Initializing domain class
$my_domain=new domain("the-domain-to-check.com");

// Printing out all supported top level domains
$tlds=$my_domain->get_tlds();
for($i=0;$i<count($tlds);$i++){
	echo $tlds[$i];
}

</ example>

3. License information
======================

These class is licensed by GPL. For further information
please visit http://www.opensource.org/licenses/gpl-license.php



4. Credits
==========

Thanks to:

- All people who helped me to develope this class
Return current item: domain