When ThinkPHP receives the JSON data sent by the front end, it uses the
Reason: ThinkPHP will filter the received data by default, so after the JSON [string] is filtered, an error occurs.
Solution: Use the following methods to receive data, raw data (unfiltered)
// Get all variables of the current request (raw data) Request::instance()->param( false ); // Get all get variables (original array) Request::instance()->get( false ); / / Get all the original post variables Request::instance()->post( false );
Then you can
json_decodeparse the json string again.