![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: how to, parse, php, xml |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |
| The Following User Says Thank You to TeraTask For This Useful Post: | ||
HelloWorld (10-28-2007) | ||
| ||||
| what does it return? can I use below XML: Code: <?xml version="1.0" encoding="utf-8"?> <playlist version="1" xmlns="http://xspf.org/ns/0/"> <trackList> <track> <title>Streamline</title> <creator>Newton</creator> <location>test1</location> <image>test1a</image> </track> <track> <title>LSE</title> <creator>Hello</creator> <location>test2</location> <image>test2a</image> </track> </trackList> </playlist> $title[0] will give me Streamline.. something like that Last edited by HelloWorld : 10-28-2007 at 07:30 PM. |
| ||||
| Yes, it will parse that. It returns an array. Try it! Remember, you can always use var_dump or print_r to see the structure of the returned object. |
| The Following User Says Thank You to TeraTask For This Useful Post: | ||
HelloWorld (10-28-2007) | ||
| ||||
| Hmmm...I'm not sure that here is the best place to reiterate how to use PEAR, but you should make sure that the libraries are available, include them, and whenever saying "it didn't work", go back and delete that phrase and include the specific error message. "It didn't work" is a taboo when reporting problems - it communicates nothing. Programs don't "just not work", they throw errors, fail to return a result, crash, ... they do something. "It didn't work" is an assertion of the negative (a non-existent), but programs always do something and act accordingly which is an assertion of something positive (something which is existent). For instance, what you say here is not true: it did work (in the sense that something was done, not that your intentions were completed) and an error was thrown. Very likely it was that the XML_Parser class is not defined. That would be because you need to either install the module or download a local copy. Instructions on how to do that are at PEAR :: Manual :: Installation . I see you've done some additional experimenting while I was composing this, so I'll end it here. |
![]() |
| Thread Tools | |
| Display Modes | |
| |