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 ...

Get Core PHP Programming, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.