Write JSON data to text file with PHP [duplicate]
问题 This question already has answers here : Issue reading HTTP request body from a JSON POST in PHP (2 answers) How to update/edit a JSON file using PHP [closed] (1 answer) Closed 2 years ago . Problem: I have a script that send JSON data to a PHP file in this way: var xmlhttp = new XMLHttpRequest(); xmlhttp.open("POST", "process-survey.php"); xmlhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); xmlhttp.send(JSON.stringify({uid, selected})); The problem is that JSON data