i am useing an API getting some json objects.
The one i need is: results_html
When you look at the name you see it will be html. My problem is, in the json it is unicode encoded. When i try to decode it some characters are wrong!
I tried out JSON_UNESCAPED_UNICODE and i tried out some str_replace() things like this:
$json_object = str_replace('\u2122', 'e2 84 a2;', str_replace('\u2605', 'e2 98 85', file_get_contents($url)));
$json_decoded = json_decode($json_object);
But i didnt get any good result! Sometimes the total json crashes or the chars are bad anyway.
EDIT: Here is an example: WHen i use:
$json_object = file_get_contents($url);
$json_decoded = json_decode($json_object);
$html = $json_decoded -> results_html;
the $html will echo this in an utf8 encoded html body: â StatTrakâ¢
Does somebody have any idea?
Thank You so far.