Use var_dump to output an object. What are the attributes? For example, if var_dump outputs a SimpleXMLElement object, the following object (SimpleXMLElement) #4 (3) {& nbsp; [& quot; @ attributes & quot;] = & gt; is displayed; & n outputs an object using var_dump. What are the attributes?
For example, var_dump outputs a SimpleXMLElement object, which is displayed as follows:
Object (SimpleXMLElement) #4 (3 ){
["@ Attributes"] =>
Array (1 ){
["Index"] =>
String (1) "1"
}
["Name"] =>
String (7) "Book 1"
["Story"] =>
Array (3 ){
[0] =>
Object (SimpleXMLElement) #5 (2 ){
["Title"] =>
String (14) "Book 1 story 1"
["Quote"] =>
String (20) "Book 1 story 1"
}
[1] =>
Object (SimpleXMLElement) #6 (2 ){
["Title"] =>
String (14) "Book 1 Story 2"
["Quote"] =>
String (20) "Book 1 Story 2"
}
}
}
What does the @ ["@ attributes"] mean? please give a similar class. thank you.
------ Solution --------------------
You use SimpleXMLElement to talk about things, not me.
PHP code
$a = array( '@abc' => 2);settype($a, 'object');echo $a->{'@abc'};