There is a checkdnsrr function in the PHP system function. The function of this function is to check whether it has a DNS record based on a given host name (domain name) or IP address. The purpose is to verify whether it actually exists. However, this function can only be used under Linux systems and does not support Windows platforms. The following is a hack method collected on the Internet to simulate the checkdnsrr function on the window platform to detect whether an email exists!
if(!function_exists('checkdnsrr')){ function checkdnsrr($host,$type=''){ if(!empty($host)){ $type=(empty($type))?'MX':$type; exec('nslookup -type='.$type.' '.escapeshellcmd($host),$result); $it=new ArrayIterator($result); foreach(new RegexIterator($it,'~^'.$host.'~',RegexIterator::GET_MATCH) as $result){ if($result){ return true; } } } return false; } }
Next, let me introduce the parameters of this function:
bool checkdnsrr ( string $host [, string $type = "MX" ] )
We won’t talk about the first parameter, it is the domain name or ip
The second parameter is the analysis type, respectively:
A (Address) record is the IP address record corresponding to the specified host name (or domain name).
MX record is the specified mail exchange record (default)
NS record is a record that specifies the domain name server, specifying which DNS should resolve the domain name.
SOA records are generally used in secondary DNS servers to specify who is the primary server.
PTR record Reverse resolution record pointing from IP to domain name
CNAME record Alias record
AAAA record is a record pointing to IPv6
A6 record
SRV record It is a type of resource record supported in the DNS server database. It is generally used when setting up Microsoft's Active Directory.TXT record Text information
ANY record Any record, all data types Method
php function to get the first letter of Chinese pinyin (really usable)
Sphinx is installed and used under windows [supports Chinese full-text search]php judgment function, class , whether the class method existshttp: //www.bkjia.com/PHPjc/813353.html