Sunday, 13 April 2014

An Introduction to XML in Php

xml language

Its Quick Introduction about xml now some of you may know about xml and some of you may not. But xml becoming part on internet in how we transfer pick up data from different websites and also how we become transfer data from database to another database using custom tags inside xml file. XML stands for extensible markup language and it is a markup language So, its similar to html similarly we use markup tags.


For example in html we define tags like

<html>

</html>

But in xml what we can do we can create our own custom tags that allow us to define data and pickup data using different tags. 

For Example For XML File
xml file
Screenshot1


<producers>

<producer>

<name>alex</name>

<age>21</age>

</producer>

<producer>

<name>Billy</name>

<age>16</age>

</producer>

<producer>

<name>Dale</name>

<age>49</age>

</producer>

</producers> 


We had Producers tag inside we have producer tags inside we had name tags and age tags then we duplicate it 3 times. Now this may all look they may not make sense however what we had done here is we created structure way of displaying our data now if i would to say someone bring 2 and 3rd producer what it will be able to do access this tags. Its access the producers tags first of all then coming through inside we had to say feed this into the array and we can able to select just 2 and 3rd producer means billy and dale with there ages information. to last producer so, its great way to transfer data around the web and in the format recognized depending on what tags its view so you can have access what tags are and which tags are required. So, this xml data we can read through different web applications and software.

Why it is useful in php programming

xml file
Screenshot2

Now You may notice that or may not facebook, twitter, Youtube all have preset xml file for different users so for example lets just bring up an example youtube xml file Screenshot2. Now its Not correctly structured in times to Independence things like that if we go down information's about videos users you get description of video , You can also see media title its just the general information this all can be read by using php now we going to work with creating our own simple xml file and reading and learning how to read them in. Then what we going to do is we will take an example of a data feed from either youtube or another social networking website. That we can access a users feed for example from twitter and things like that. Now its the introduction to xml file you can go to different website and see how they make there xml files and have a carefully look at some may be structured some may be not be like screenshot2.  



No comments:

Post a Comment

Thanks For Comment Will get you Soon..

About Me

Welcome to Extra Tutorials! My name is Mohammed and I am the 22 year writer, website developer, and photographer behind the blog. Thanks for visiting! Tutorials Jackpot… In addition to Developer, I love to develop websites and I love to write. Starting a php Blog was inevitable for me. What began as a simple way to share all of my Tutorials with friends and family has developed into my Part time job.

Mohammed Padela

WHAT IS PHP PROGRAMMING

WHAT IS PHP PROGRAMMING
WHAT IS PHP PROGRAMMING

Follow Us

Popular Posts

Designed ByBlogger Templates