PHP Script for domain name checker

Is there any available scripts to check whether the domain name is available?

What do I need to have this done?

Many of the large domain registrars have an API that you can hook in to.
Have you looked in to that already?