开发者

Accessing SimpleXML Object attribute

开发者 https://www.devze.com 2022-12-08 21:01 出处:网络
Have this print output from print_r($theobject); SimpleXMLElement Object ( [@attributes] => Array ( [label] => a

Have this print output from print_r($theobject);

SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [label] => a
        )

    [0] => Abnormal psychology : Abnormal psychology :
)

Just cannot find a way to get element开发者_C百科 0 which is "Abnormal psychology :"

Lets call the object as $theobject I did $theobject[0], didn't get anything.

Many Thanks


You can just cast the object to a string:

$str = (string)$theobject;
0

精彩评论

暂无评论...
验证码 换一张
取 消