get strings from XML using php
Posted: Tue Nov 20, 2007 2:30 am
I am trying to figure out how xml and php work together. It seems more complicated than fread().
I have several xml files in a folder which have the data I want to display on a page,
how can I read the sections and display them on the page using php?
Let's say the .xml file is:
So when read, it would display:
Welcome
welcome to my site.
2nd post
this is another post. http://www.google.com
I have several xml files in a folder which have the data I want to display on a page,
how can I read the sections and display them on the page using php?
Let's say the .xml file is:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<post>
<title><b>Welcome</b></title>
<description>welcome to my site.</description>
</post>
<post>
<title><b>2nd post</b></title>
<description>this is another post. <a href="http://www.google.com"> http://www.google.com </a></description>
</post>
<?xml>Welcome
welcome to my site.
2nd post
this is another post. http://www.google.com