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?
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.
so probably like this:
Well, yes, that's better. If you going to store this in a file, you should add this to the top of file (it should be the very first line)
Originally Posted by JordashTalon
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!