ok, I've got XML scripts that work in PHP 4.x however this last weekend I was forced by my host to move to php5 & apache 2.
I do not normally do much with the XML side of things with php.
I am asking if you could help me by providing a simple method to not only read and xml file (format to follow), but associate each element to it's own variable.
using SIMPLEXMLELEMENT I get the following array, however I'm unable to see how it's structured to break apart for the seperate variables. if you can help with that it would be even better.
SimpleXMLElement Object ( [MODULEINFORMATION] => SimpleXMLElement Object ( [TITLE] => Photo Gallery Manager [TEMPLATE] => file.php [DESCRIPTION] => Photo Gallery Manager [FRONTMODULELOCATION] => SimpleXMLElement Object ( ) [ADMINMODULELOCATION] => glry [DBTABLE1] => GALLERYITEMS [DBTABLE2] => GALLERYNAMES [DBTABLE3] => SimpleXMLElement Object ( ) [REQUIREDMODULES1] => SimpleXMLElement Object ( ) [REQUIREDMODULES2] => SimpleXMLElement Object ( ) [REQUIREDMODULES3] => SimpleXMLElement Object ( ) [REQUIREDMODULES4] => SimpleXMLElement Object ( ) ) )
// This part doesn't work (at least doesn't display anything)
//$sxe = simplexml_load_file("./modules/gallery/module.xml");
//foreach($sxe->item as $item) {
// print $item->template ." ";
//}
// this part works.
$xml = simplexml_load_file("./modules/gallery/module.xml");
//this doesn't display just the table
echo $xml->DBTABLE1; // outputs 'abcdefg'
// this displays the entire array.
print_r($xml);