{"code":100,"data":[{"id":"1"},{"id":"2"},{"id":"3"},{"id":"4"},{"id":"5"},{"id":"6"},{"id":"7"},{"id":"8"},{"id":"9"},{"id":"10"}]}
The above Json is completely legal, but when decoded by the client server (PHP), it becomes null. json_last_error_msg() prompts a syntax error, which is puzzling.
Add ob_clean() before output to clear the cache to solve the problem
The above introduces a pitfall of php json syntax_error syntax error, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.