New json_validate() function in PHP 8.3

by

As you all know that PHP 8.3 version has been released. Today I am going to talking about one of the new function json_validate() introduced in PHP 8.3

var_dump(json_validate('{ "test": { "foo": "bar" } }')); // true

json_validate() allows to check if a string is syntactically valid JSON and it is more efficient than json_decode().

Leave a Reply

Your email address will not be published. Required fields are marked *