这是因为文件本身带了BOM头,造成json_decode函数无法识别 可以用下面的方法去掉这个头 $data = json_decode(trim($fileSource,chr(239).chr(187).chr(191)),true);