On the AnyExamples.com website, there's a new little how to on making a whois client in PHP (without just using an exec or similar call to the filesystem).
This article contains PHP implementation of whois client (as a function ae_whois), which may be used to request domain information from specified whois servers.
Their method uses the socket functionality (fsockopen, fwrite, fclose) to make a connection to the remote server for the specified domain's information.