10. Networking with PHP

The vast bulk of what PHP is used to do is based on taking information from the server (like a database or a text file) and sending it to the client (the end-user’s Web browser), or vice versa. But PHP also supports a slew of features for the purpose of interacting with other Web sites, communicating with other servers, and even FTP’ing files. In this chapter, I’ll discuss and demonstrate some of PHP’s network-related functions and capabilities.

In the first example, you’ll see how to read data from another Web site as if it were any old text file. In the second, a Web site verifier ...

Get PHP Advanced and Object-Oriented Programming: Visual Quickpro Guide, 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.