我有一个Json字符串,我使用php的json_decode解码它。 p>
字符串 p>
“address”:{
“address”:null,
“postalCode”:null,
“phoneNumber”:“”,
“ city“:null
}
code> pre>
当我解码字符串时我得到 p>
[”address“] =>
array(1){
[“phoneNumber”] =>
string(0)“”
code> pre>
它实际上剥离了属性 使用null作为值,即地址,城市。 我能否防止这种情况发生。 p>
COMPLETE JSON h3>
{“cost”:null,
“receiptNumber”:null,\ n“receiptType”:null,
“labNo”:596726,
“parentLabNo”:0,
“survey”:“BS for mps”,
“patient”:{
“id”:168967,
“fullName”:“UVOGIN”,
“dateOfBirth”:“1972-04-04 00:00:00”,
“性别”:“男性”
},
“地址”:{\ n“address”:null,
“postalCode”:null,
“phoneNumber”:“”,
“city”:null
}
}
code> pre>
< / DIV>