Home  >  Article  >  Backend Development  >  How to send xml data in php and parse it

How to send xml data in php and parse it

WBOY
WBOYOriginal
2016-08-18 09:16:271089browse

I am working on interfaces recently, but interface requests and responses are all in the form of data in xml format. This is my first time coming into contact with xml and I don’t know much about it. I hope the experts can give me some advice.

Reply content:

I am working on interfaces recently, but interface requests and responses are all in the form of data in xml format. This is my first time coming into contact with xml and I don’t know much about it. I hope the experts can give me some advice.

Just send it as a string. . . There are parsers such as simplexml. You can take a look. In fact, you can treat it as string concatenation.

When parsing, PHP comes with many functions
http://php.net/manual/zh/refs...

Sending xml is actually sending strings or json, there is no difference

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn