How to get attribute with SimpleXML?

I use simplexml_load_file($path_xml_file) , it works well!

If I do print_r($xml) , it prints:

 SimpleXMLElement Object ( [@attributes] => Array ( [Message] => Login Successful [Token] => 11111111111 [DataFormat] => CSV ) ) 

How can I get the value of the token?

Thanks!

+7
php simplexml
source share

No one has answered this question yet.

See similar questions:

3
How to parse HTML CDATA XML content using SimpleXML?
2
How to get values ​​from xml if the node has attributes?
one
simplexml does not read CDATA
0
Sync XML Links with PHP
0
I do not understand the result in XML objects and PHP SimpleXMLElement
0
Pulling data from XML into my HTML page
-4
Retrieving tag attribute content from XML

or similar:

4270
Link. What does this symbol mean in PHP?
2776
How can I prevent SQL injection in PHP?
2664
How to check if a string contains a specific word?
2263
How to get thumbnail of YouTube video using YouTube API?
1624
How do I get PHP errors?
151
Get value from SimpleXMLElement object
fifteen
Looping through a SimpleXML object or turning an entire object into an array
0
Failed to get Fogbugz API response to SimpleXML object
0
SimpleXML stores attributes in an array
0
get @attributes from an array from simplexml_load_file after xpath with php

All Articles