Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Php PHP XML and PHP Backends Sharing Data Tutorial

 
 

Share on Google+Share on Google+

PHP XML and PHP Backends Sharing Data Tutorial

Advertisement
What if you could script remote procedure calls between web sites as easily as you can do among programs? This tutorial will explain how it can be done in PHP.

PHP XML and PHP Backends Sharing Data Tutorial

     

PHP XML and PHP Backends Sharing Data Tutorial

What if you could script remote procedure calls between web sites as easily as you can do among programs? This tutorial will explain how it can be done in PHP.

XML and PHP Backends Sharing Data

Scripting languages have been in use for years to make function calls and to integrate disparate applications. A little bit of script glue can make applications from different vendors talk to each other and exchange information.
Ever wished you could do that for web sites? Well, now you can. XML-RPC is a very simple protocol for performing remote procedure calls over HTTP. It was designed by Userland Software , working with Microsoft .

First of all we need to create an xml file and save it in the same directory where you will develop your php file. As you might know that an xml file is easy to create, it supports user-defined tags. So just copy and paste the following xml code or you may write your own:

MyFirst.xml

<?xml version="1.0" encoding="ISO-8859-1" ?>
<lang>
<php>
PHP is very easy to learn
</php>
<Java>
Java is the king of open source language
</Java>
</lang>

phpXml.php

<?php

$cont=simplexml_load_file("MyFirst.xml");

echo $cont->getName().'<br/>';

foreach($cont->children() as $child)

{

echo $child->getName().':'.$child.'<br/>';

}

?>

Output:

lang
php: PHP is very easy to learn
Java: Java is the king of open source language

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 20, 2009

Related Tutorials

Discuss: PHP XML and PHP Backends Sharing Data Tutorial  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com