I am unable to handle JSON decode errors. Here is my code:
try {
$jsonData = file_get_contents($filePath) . ']';
$jsonObj = json_decode($jsonData, true);
}
catch (Exception $e) {
echo '{"result":"FALSE","message":"Caught exception: ' . $e->getMessage() . ' ~' . $filePath . '"}';
}
I am a new PHP programmer. Sorry, if something is wrong.