1. Confirm that the file has no BOM header
2. Tried the following ways to remove illegal strings, but still output NULL
$some_string = htmlspecialchars_decode($some_string);
$some_string = preg_replace("/\t/", " ", $some_string);
$some_string = preg_replace("/\n/", " ", $some_string);
$some_string = str_replace("\n", " ", $some_string);
$some_string = str_replace ("\n","", $some_string);
3, json_last_error () output 4pm Syntax error, malformed JSON
4. Output the string directly, and the browser can parse josn normally, as shown in the screenshot