Jump to content

Simple XML Parsing For A Beginner


tarun

Recommended Posts

Well Say I Have An XML File:

<?xml version="1.0" encoding="ISO-8859-1" ?> 
  <udata>
      <uname>tarun</uname> 
      <age>12</age> 
      <hobby>php</hobby> 
      <profile>
[center][color=red]Welcome To My Profile[/color][/center]
</profile> 
  </udata>
  <udata>
      <uname>john</uname> 
      <age>13</age> 
      <hobby>asp</hobby> 
      <profile>
[left][color=blue]Welcome[/color][/left]
</profile> 
  </udata>

 

 

How Do I...

1. If uname tag Is tarun Display The profile tag

2. List All The Ages In A List

e.g.

12

13

18

43

 

 

AnY HelP...?

Thnx,

Tarun

35

Link to comment
https://forums.phpfreaks.com/topic/48326-simple-xml-parsing-for-a-beginner/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.