I've tried some of those solution but nothing was working for me. I try this simple thing :
$isJson = json_decode($myJSON);
if ($isJson instanceof \stdClass || is_array($isJson)) {
echo("it's JSON confirmed");
} else {
echo("nope");
}
I think it's a fine solutiuon since JSON decode without the second parameter give an object.
EDIT : If you know what will be the input, you can adapt this code to your needs. In my case I know I have a Json wich begin by "{", so i don't need to check if it's an array.