API PHP for a known store how to send an HTTP request and get the returned XML

Source: Internet
Author: User
API PHP for a known store how to send an HTTP request and get the returned XML
Ask for advice

------Solution--------------------
There are APIs, just follow the interface specifications OK AH

Methods are generally: File_get_contents,curl,fsockopen

The specific choice of which depends on your API and the specific use of the environment


Your problem description is almost 0, not a good way to ask questions.
------Solution--------------------
JScript Code

------Solution--------------------
discuss

Reference:

There are APIs, just follow the interface specifications OK AH

Methods are generally: File_get_contents,curl,fsockopen

The specific choice of which depends on your API and the specific use of the environment


Your problem description is almost 0, not a good way to ask questions.


Well, the value returned by the API is the file_get_contents of the XML, the function reads the contents.

------Solution--------------------
Now that you've got the content, the rest of the process is to study it yourself.
PHP parsing XML method on the net catch a lot of

Believe in yourself, no problem.
------Solution--------------------
discuss

Reference:

Isn't that what you got? What else do you want?

I was just trying to get the XML, and see how to read the label.

------Solution--------------------
discuss

Reference:

Reference:

Isn't that what you got? What else do you want?

I was just trying to get the XML, and see how to read the label.


That 's all you have to read. My code returns all the content numbers.

------Solution--------------------
Use SimpleXML to parse the array, and the key to it is the tag you want.
------Solution--------------------
DOMDocument and SimpleXML are all official libraries, write a recursive function to traverse it.
  • Related Article

    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.