Php processes post raw data (online, etc.) XX software, connect hxxp: // why .? If this XX software sends php to handle post raw data problems (online, etc)
XX software, connect to hxxp: // www.test.com/input.php
After the communication is connected, the XX software sends a text file, for example, abc.txt.
Then, after the php operation, return a piece of jason string to the software, and finally the software runs the corresponding function .?
If the xxsoftware sends abc.txt (verify, deny, not commit, and other information), the php operation returns {"id": xxx, "url": "xxx", "port ": "xxx "}
How should such php be written?
I tried to use php: // inputto receive abc.txt, but what should I do after receiving it, and how can I return a string in jason format after processing it?
Thank you for your advice!
Share:
------ Solution --------------------
Neither will I. I will help you with it!
------ Solution --------------------
The FILE information received by php will exist in the $ _ FILE global array, and then the txt FILE is moved to the server through move_uploaded_file. then, the content in the txt FILE is obtained using file_get_contents, and then the content is processed to generate json, finally, echo the json
------ Solution --------------------
$ T = array_diff(file('kkk.txt ', FILE_IGNORE_NEW_LINES), file('abc.txt', FILE_IGNORE_NEW_LINES ));
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.