Reputation: 111
How can I clean Dirty JSON String format ?
For Example from this String
{"AS_applicant_Data__c":"{\\\"Full Name\u00a0\\\":\\\"asdffas\\\"}"}
to this format
{"AS_applicant_Data__c":"{"Full Name":"asdffas"}"}
Upvotes: 1
Views: 3164
Reputation: 16963
Use str_replace
to remove all occurrences of \
and u00a0
from your json string, like this:
echo str_replace('u00a0', '', str_replace('\\', '', $json_string));
Output:
AS_applicant_Data__c":"{"Full Name":"asdffas"}"}
Upvotes: 2