Let's say I have the following XML structure:
<?xml version="1.0" encoding="UTF-8"?> <main> <parent> <child1>some value</child1> <child2>another value</child2> </parent> </main>
I made an XML variable and now I want to get the values โโof child1, so I use SimpleXML:
$xml = new SimpleXMLElement($xml); $this->xmlcode = (string) $xml->main->parent->child1;
But I get this message: Note: attempt to get non-object property in /x.php on line x
I also tried it with $ xml-> parent-> child1, but didn't succeed.
Is anyone ??
priktop
source share