I have a Json string and I am decoding it using php's json_decode.
The string
"address": {
"address": null,
"postalCode": null,
"phoneNumber": "",
"city": null
}
When I decode the string I get
["address"]=>
array(1) {
["phoneNumber"]=>
string(0) ""
It essentially strips the attributes with null as a value i.e address, city. Can I prevent this from happening.
COMPLETE JSON
{"cost": null,
"receiptNumber": null,
"receiptType": null,
"labNo": 596726,
"parentLabNo": 0,
"investigation": "BS for mps",
"patient": {
"id": 168967,
"fullName": "UVOGIN",
"dateOfBirth": "1972-04-04 00:00:00",
"gender": "Male"
},
"address": {
"address": null,
"postalCode": null,
"phoneNumber": "",
"city": null
}
}