SimpleXMLElement related issues

Source: Internet
Author: User
SimpleXMLElement problems
Object (SimpleXMLElement) [7]
Public ' trades ' =
Object (SimpleXMLElement) [8]
Public ' @attributes ' =
Array (size=1)
' List ' = = String ' true ' (length=4)
Public ' Trade ' =
Array (size=3)
0 =
Object (SimpleXMLElement) [9]
...
1 =
Object (SimpleXMLElement) [10]

Print $xml out so how to get the trade in the form of an array

$xml->trades->trade gets the always array first object
Same as $xml->trades->trade[0] results

Master, if the simplest one gets to the contents of the trade array


------Solution--------------------
Print_r ($xml->trades->trade); What's the result?
------Solution--------------------
You can use arrays to manipulate them,
such as $xml->trades->trade[0],
But you can't think of him as an array.

By default, the first item is taken.

  • 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.