December 2001
Intermediate to advanced
520 pages
13h 42m
English
Even though PHP itself is normally used to create Web sites, it can also access and interact with Web pages on its own. This can be useful for retrieving information, writing spiders (applications that scour the Internet for particular data), and more. Surprisingly, you can access other Web sites in much the same way you would access a text file on your hard drive: by using fopen().
fopen ("http://www.dmcinsights.com/phpadv/", "r");
The fopen() function used for opening files can also open Web pages because they are, after all, just files on a server. The parameters for using fopen() are the same (r, w, and a), although you will be limited to opening a file only for reading unless the file's permissions are ...
Read now
Unlock full access