O'Reilly logo

Advanced PHP for Web Professionals by Christopher Cosentino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data Mining

Many Web pages provide a lot of useful information. Sometimes the information you need is surrounded by a lot of other information that you don't need or want. Using PHP, it is possible to read a page on the Web and extract the information you need.

When extracting information from other sites, it is important to remember that any data on another site is most likely copyrighted. Do not use other people's data for your own purposes without express permission from the owner of that data.

This next example details how to retrieve a stock quote from the Reuters News Service Web page. This is merely an example and should not be used on your own site unless you have expressly written consent from Reuters to use their data.

HTML is a rather ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required