Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

json_validate()

3 tags 1 category

json_validate() — Checks if a string contains valid JSON.

Returns whether the given string is syntactically valid JSON. If json_validate returns true, json_decode will successfully decode the given string when using the same depth and flags.

If json_validate returns false, the cause can be retrieved using json_last_error and json_last_error_msg.

json_validate uses less memory than json_decode if the decoded JSON payload is not used, because it does not need to build the array or object structure containing the payload.

Inputs: json: The string to validate. This function only works with UTF-8 encoded strings. depth: Maximum nesting depth of the structure being decoded. The value must be greater than 0, and less than or equal to 2147483647. flags: Currently only JSON_INVALID_UTF8_IGNORE is accepted.

Returns: Returns true if the given string is syntactically valid JSON, otherwise returns false.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…