Suppose a string contains the json string and you want to validate if it is correct as per json standard. Follow the following simple code -
$decoded_json = json_decode($json);
if($decoded_json === null) {
// $decoded_json is null because json cannot be decoded
}