PHP file_get_contents打开文件 无法json_decode问题

这是因为文件本身带了BOM头,造成json_decode函数无法识别

可以用下面的方法去掉这个头

$data = json_decode(trim($fileSource,chr(239).chr(187).chr(191)),true);

评论

暂无评论