Use var_dump to output an object. What are the attributes? What should I do?

Source: Internet
Author: User
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'};

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.