For example, $testStr = 'Hello, please help';
// It is in utf-8 format $testStr
is a variable, so I don’t know if it is There is no garbled code, and the garbled code is somewhere, so the method of removing it by interception does not seem to work.
$testStr1 = json_encode($testStr);
var_dump($testStr1);
prints as false
It’s because there are garbled characters. How to parse the string with garbled characters? Please give me some advice. Thank you.
ringa_lee2017-05-31 10:35:50
php’s json_encode transcoding arrays containing Chinese characters requires adding parameters, json_encode($array, JSON_UNESCAPED_UNICODE).