I receive some generated json files and some files would contain the ™ symbol, if the file has that then json_decode
won't work on it, when I print $data
NULL will be printed. If I manually remove the symbol then I will see the data.
I am using the below code and it will print out what is in the json file until it gets to the json file that has the ™ symbol
$json = file_get_contents($count . '.json');
$data = json_decode($json);
echo '<pre>';
var_dump($data);
echo '</pre>';
I have tried using urlencode
and urldecode
and htmlspecialchars
but they don't work either.