小编Dea*_* Or的帖子

json_encode返回NULL,json_last_error_msg给出"控制字符错误,可能编码错误"

读入我的编辑器时,该文件看起来很好.

$file = file_get_contents('path/to/file.json');
$json =  json_decode($file, true);
var_dump($json); // null
echo json_last_error_msg(); //Control character error, possibly incorrectly encoded
Run Code Online (Sandbox Code Playgroud)

关于此错误消息的含义并不多.

php json

5
推荐指数
1
解决办法
3587
查看次数

标签 统计

json ×1

php ×1