我编写了一个Java程序,它接受一个JSON对象并发送给php。但是,当我在PHP中收到JSON时,会返回一个损坏或不完整的数组,如下所示。
我从java发送这个JSON对象,在java中我可以打印JSON对象,它显示得很好:
{"Description":"now locatio-n","ReportedByFirstname":null,"DateReported":null,"Name":"now","FacilityId":"13692","LocationDescription":"now locatio-n","ReportedByPersonId":null,"ReportedByMobileNumber":null,"StatusId":"22","ReportedByLastname":null,"ReportedByEmail":null,"Id":"957394","PriorityId":"2","LocationLat":"","LocationLong":""}
在PHP中,我打印如下所示的值:
print_r($_POST);
结果如下:请注意第一个元素描述并未完全显示。
Array
(
[defect] => -n","ReportedByFirstname":null,"DateReported":null,"Name":"now","FacilityId":"13692","LocationDescription":"now locatio-n","ReportedByPersonId":null,"ReportedByMobileNumber":null,"StatusId":"22","ReportedByLastname":null,"ReportedByEmail":null,"Id":"957394","PriorityId":"2","LocationLat":"","LocationLong":""}
)