Results 1 to 5 of 5
Thread: Very Basic XML
May 27, 2009, 19:18 #1
Very Basic XML
I have an XML file like this
saved as filename.xml
How would I get the all of the varnames into variables in PHP?
May 27, 2009, 19:28 #2
This is probably not a valid xml file.
You should have only one root element in the xml file, then under the root you can put all your varname elements.
Then just use SimpleXML to parse your file.
look at this page:
It's hard to write an example because I don't know all the details, for example. do you know in advance which varnames you will have in the xml?
It's pretty simple either way.
May 27, 2009, 19:32 #3
so probably like this:
May 27, 2009, 19:37 #4
May 27, 2009, 19:43 #5
That helped I read through that link you gave me and looks like PHP has some sweet XML reading functions I did this
echo 'Variable One: ' . $variables->varname;
and that will do exactly what I need,
Thanks for the help!