Networking is an integral part of PHP's capability as a web language, and its implementation of various networking capabilities is unsurprisingly vast - you could write a book on PHP networking alone.
Although fopen() allows you to work with HTTP and FTP, using the more specific functions allows you to take full advantage of PHP's capabilities - particular with FTP, all the really good stuff is only accessible from the dedicated FTP functions.
Curl is a powerful and flexible way to handle a number of network protocols through one programming interface. We've only scratched the surface here; a more detailed examination on your behalf will certainly yield big results!
LDAP is a trusted and popular network protocol that's in use around the world in large companies to help them organise their workforce. With PHP, LDAP finds a home outside its traditional areas (eg mail clients), and there are many cool applications for it there.
Want to learn PHP 7?
Hacking with PHP has been fully updated for PHP 7, and is now available as a downloadable PDF. Get over 1200 pages of hands-on PHP learning today!
If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!
Next chapter: Exercises >>
Previous chapter: The Morse code stream
Home: Table of Contents
Copyright ©2015 Paul Hudson. Follow me: @twostraws.