How to Check if a String Is Valid JSON in PHP: json_validate() (and When Not to Use It)
PHP 8.3's json_validate() tells you if a string is valid JSON without decoding it. Tested examples, and the one time you shouldn't use it.https://iancroasdell.wordpress.com/2026/11/14/php-json-validate-check-valid-json/