如何顯示以下代碼中的單個值?php - 如何顯示來自SimpleXMLElement的值
SimpleXMLElement Object (
[@attributes] => Array
(
[stat] => ok
)
[profile] => SimpleXMLElement Object
(
[address] => SimpleXMLElement Object
(
[country] => United Kingdom
)
[displayName] => gareth
[name] => SimpleXMLElement Object
(
[givenName] => Gareth
[familyName] => Davies
[formatted] => Gareth Davies
)
[preferredUsername] => gareth
[providerName] => Google
[verifiedEmail] => [email protected]
)
)
$ simpleXml = ...? 會寫這個 $ simpleXml = simplexml_load_string($ auth_info); $ givenName = $ simpleXml ['givenName']; echo $ givenName; – gareth 2009-11-16 16:16:45