这是因为文件本身有BOM头,导致json_decode函数无法识别。您可以使用以下方法删除此标头。$data=json_decode(trim($fileSource,chr(239).chr(187).chr(191)),true);
PHPfile_get_contents无法打开文件,json_decode问题相关文章