O'Reilly logo

PHP Ajax Cookbook by R. Rajesh Jeba Anbiah, Roshan Bhattarai, Milan Sedliak

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

Creating and consuming web services using PHP

PHP can be used for creating and consuming web services. PHP has powerful libraries for creating and consuming web services that use SOAP or XML-RPC or REST.

Let's try to understand how to consume web services in PHP using a simple example. In this example, we're going to get the details of a phrase from the API of Wikipedia.

Getting ready

Wikipedia (http://www.wikipedia.org) is a free web-based multilingual encyclopedia. Almost all of its articles can be edited by anyone if they have more information about the subjects. It is probably the largest and most popular website where people find information about general knowledge or specific topics. Currently, Wikipedia has articles in 282 languages.

How ...

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