PHP
  Home arrow PHP arrow Fetching Search Results as Serialized ...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Fetching Search Results as Serialized Arrays with Yahoo Web Services and PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-01-15

    Table of Contents:
  • Fetching Search Results as Serialized Arrays with Yahoo Web Services and PHP 5
  • Displaying web services search results in XML format
  • Next Example
  • Serving outputs of Yahoo! Web services as serialized PHP arrays
  • Iterating over array elements with PHP 5

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    TestComplete™ automates software testing for a fraction of what the big guys charge. Easy functional and load testing for all Windows, .NET, Java and Web apps. Download a free trial now.

    Fetching Search Results as Serialized Arrays with Yahoo Web Services and PHP 5
    (Page 1 of 5 )

    In this second article of the series dealing with the implementation of some of the most useful web services offered by Yahoo! with PHP 5, I’ll show you how to parse the results returned by a determined web search service using a few array PHP processing functions.

    Many modern web sites use popular web services, such as image and video searches. Their correct implementation has proven to be very useful when it comes to attracting new visitors that are looking for a richer and more productive surfing experience.

    However, as you’ll possibly know, using a given web service in conjunction with a powerful server-side scripting language like PHP 5 can be quite challenging. This is particularly true if the web service must be implemented from scratch using WSDL (Web Service Description Language).

    Fortunately, there are some frameworks available on the web that will let you easily use a determined web service without having to deal directly with data delivered in XML format. And that’s precisely the case with Yahoo! Web Search Services, which can be directly invoked within your own PHP applications by writing only a few lines of code.

    Naturally, if you already went through the first article of the series, then you’ll surely be very familiar with using these web services provided by Yahoo! straight from a simple PHP script. As you’ll possibly recall, during that tutorial I built some illustrative hands-on examples aimed at demonstrating how to utilize Yahoo!’s Image and Video Search Services, among others, using only small pieces of PHP 5 code.

    The results returned by these hands-on examples, after querying one of the aforementioned web services, always outputted in XML format. This can be rather intimidating for some PHP developers who want to implement those services within the context of their own applications.

    Nevertheless, the good news is that all of the web services offered by Yahoo! permit the specification of an additional “output=php” parameter within the corresponding query string, which indicates that all of the results retrieved should be returned in the form of a serialized PHP array. Indeed, as you can see, this feature simplifies displaying the respective search results in a more readable format, since PHP has plenty of native functions aimed at processing array elements.

    Now, having introduced the primary subject of this tutorial, let’s learn how to fetch results returned by the different Yahoo! Search Web Services in the form of serialized PHP arrays. Let’s get started!

    More PHP Articles
    More By Alejandro Gervasio


       · Over the course of this second chapter of the series, you’ll learn how to fetch the...
     

       

    PHP ARTICLES

    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery
    - Using Timers to Benchmark PHP Applications
    - Benchmarking Applications with PHP
    - Setting Up a Web-Based File Manager: PHPfile...
    - Developing a Modular Class For a PHP File Up...
    - Setting Up a Web-Based File Manager: bfExplo...
    - Defining a Custom Function for File Uploader...
    - Parsing Child Nodes with the DOM XML extensi...
    - Creating an Error Handling Module for a PHP ...
    - Accessing Attributes and Cloning Nodes with ...
    - Retrieving Information on Selected Files wit...
    - Handling HTML Strings and Files with the DOM...
    - Building File Uploaders with PHP 5
    - Working with Multiple Document Nodes with th...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway