I am storing two sets of json data into two different columns in sql.
I am needing the compare the two strings, then highlight the string that is different. (I first tried to place the items into an array and then an array diff, doesn't deliver what I need)
Here is the first string {"Pri_ID":"340","SanctionID":"55555","PersonID":"387097","Type":"Athlete","OrgID":"253001","EntryDate":"2013-04-10"},{"Pri_ID":"349","SanctionID":"111222","PersonID":"497625","Type":"Athlete","OrgID":"253001","EntryDate":"2013-04-10"},{"Pri_ID":"334","SanctionID":"111111","PersonID":"420495","Type":"Athlete","OrgID":"253001","EntryDate":"2013-04-10"}"
here is the second string {"Pri_ID":"337","SanctionID":"111222","PersonID":"497625","Type":"Athlete","OrgID":"253001","EntryDate":"2013-04-10"},{"Pri_ID":"341","SanctionID":"111111","PersonID":"420495","Type":"Athlete","OrgID":"253001","EntryDate":"2013-04-10"},
as you can see there is a record / string deleted from the second string. I need to show the string that has been deleted.
Here is what I have done so far:
if (strcmp($str1, $str2)) {
echo $str2;
}
this doesnt not strip everything else out and show the string