O'Reilly logo

Core PHP Programming, Third Edition by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10.1. General Network I/O

The functions in this section offer general and simplified access to the Internet. Some of these functions talk to specific network services or return information about network services.

checkdnsrr

You may use checkdnsrr as an alias to dns_check_record.

boolean dns_check_record(string host, string type)

The dns_check_record function (Listing 10.1) checks DNS records for a host. The type argument defines the type of records for which to search. Valid types are listed in Table 10.1. If a type is not specified, dns_check_record checks for MX records. You may wish to read the man page for named, the Internet domain name server daemon.

Listing 10.1. dns_check_record
 <?php if(dns_check_record("php.net", "MX")) { print("php.net ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required