[eluser]rossmurphy[/eluser]
Hi,
I have an array called $xmlresponse and it contains this..
Quote:array(2) { ["xmlresponse"]=> object(SimpleXMLElement)#17 (2) { ["metadata"]=> object(SimpleXMLElement)#18 (1) { ["column"]=> array(4) { [0]=> object(SimpleXMLElement)#20 (1) { ["@attributes"]=> array(2) { ["datatype"]=> string(4) "text" ["name"]=> string(6) "userId" } } [1]=> object(SimpleXMLElement)#21 (1) { ["@attributes"]=> array(2) { ["datatype"]=> string(4) "text" ["name"]=> string(5) "token" } } [2]=> object(SimpleXMLElement)#22 (1) { ["@attributes"]=> array(2) { ["datatype"]=> string(4) "text" ["name"]=> string(13) "authenticated" } } [3]=> object(SimpleXMLElement)#23 (1) { ["@attributes"]=> array(2) { ["datatype"]=> string(4) "text" ["name"]=> string(10) "jsessionid" } } } } ["rows"]=> object(SimpleXMLElement)#19 (1) { ["row"]=> object(SimpleXMLElement)#24 (1) { ["@attributes"]=> array(4) { ["authenticated"]=> string(4) "true" ["jsessionid"]=> string(32) "CAF7D365B6CB63E261B283345BBB3812" ["token"]=> string(32) "p7yPE7zQWWFcYvNI6mD29yHCY7Cb0Bt2" ["userId"]=> string(6) "pleepo" } } } } ["apistring"]=> string(114) "http://192.168.0.42:8081/site-api/login.action?siteId=SITE&key=abc&sessionId=6900635&userId=pleepo&password=pleepo" }
I am using..
Code:
$testvar = $xmlResult->rows->row['authenticated'];
To try and get the value of 'authenticated' from the xml. I am getting an error..
Quote:A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: models/dologin.php
Line Number: 21
anyone know what im doing wrong?
Thanks