PHP handles post raw data issues (online, etc.)
XX software, go to connect hxxp://www.test.com/input.php
When the communication is connected, this XX software sends a text file such as: Abc.txt
Then after the PHP operation, back a section of Jason String to the software, and finally the software to run the corresponding function.
If this XX software sends Abc.txt (content Verify,deny,not commit and so on information), the PHP operation returns {"id": xxx, "url": "XXX", "port": "XXX"}
How should this PHP be written?
I try to receive abc.txt using Php://input, but what should I do after I receive it, and how do I return the string in Jason format after processing?
Please expert guidance, thanks!
Share to:
------Solution--------------------
I'm not going to give you a head!
------Solution--------------------
PHP received the file information will exist in the $_file global array inside, and then through Move_uploaded_file to move the TXT file to the server, and then use file_get_contents to get the contents of txt, and then the content processing, produce JSON, Finally echo the JSON
------Solution--------------------
$t = Array_diff (file (' Kkk.txt ', file_ignore_new_lines), file (' Abc.txt ', file_ignore_new_lines));