Prev | Current Page 476 | Next

W. Jason Gilmore

"Beginning PHP and MySQL: From Novice to Professional"

iana-servers.net [class] => IN [ttl] => 21564 ) )
getmxrr()
CHAPTER 16 ?–  NETWORKING 407
Retrieving MX Records
The getmxrr() function retrieves the MX records for the domain specified by
hostname. Its prototype follows:
boolean getmxrr(string hostname, array &mxhosts [, array &weight])
The MX records for the host specified by hostname are added to the array specified
by mxhosts. If the optional input parameter weight is supplied, the corresponding
weight values will be placed there, which refer to the hit prevalence assigned to each
server identified by record. An example follows:
getmxrr("wjgilmore.com",$mxhosts);
print_r($mxhosts);
?>
This returns the following:
Array ( [0] => mail.wjgilmore.com)
Services
Although we often use the word Internet in a generalized sense, referring to it in
regard to chatting, reading, or downloading the latest version of some game, what
we??™re actually referring to is one or several Internet services that collectively define
this communication platform. Examples of these services include HTTP, FTP, POP3,
IMAP, and SSH. For various reasons (an explanation of which is beyond the scope of
this book), each service commonly operates on a particular communications port.
For example, HTTP??™s default port is 80, and SSH??™s default port is 22. These days, the
widespread need for firewalls at all levels of a network makes knowledge of such
matters quite important.


Pages:
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488