Supported Versions: PHP 8 >= 8.3.0
Checks if a string contains valid JSON
<?php json_validate(string $json, int $depth = 512, int $flags = 0): bool
<?php         }



        if (function_exists('json_validate')) {

            return json_validate($value, 512);

        }



        try {
<?php         }



        if (function_exists('json_validate')) {

            return json_validate($value);

        }



        json_decode($value);