Using single 'smart quote' in my JSON data is breaking PHP script
问题 I've got a PHP script that is reading in some JSON data provided by a client. The JSON data provided had a single 'smart quote' in it. Example: { "title" : "Lorem Ipsum’s Dolar" } In my script I'm using a small function to get the json data: public function getJson($url) { $filePath = $url; $fh = fopen($filePath, 'r') or die(); $temp = fread($fh, filesize($filePath)); $temp = utf8_encode($temp); echo $temp . "<br />"; $json = json_decode($temp); fclose($fh); return $json; } If I utf8 encode