TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How to get XML data using PHP
Bhushan Singh
Oct 16
2014
Code
1.4
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
xml.zip
$xml_string
="<?xml version=
'1.0'
?>
<moleculedb>
<molecule name=
'ball'
>
<symbol>ball</symbol>
<code>A</code>
</molecule>
<molecule name=
'car'
>
<symbol>honda city</symbol>
<code>K</code>
</molecule>
</moleculedb>";
$xml
= simplexml_load_string(
$xml_string
);
foreach
(
$xml
->molecule
as
$record
)
{
echo
$record
[
'name'
],
' '
;
echo
$record
->symbol,
' '
;
echo
$record
->code,
'<br />'
;
}
xml in php
get xml data using php