Page MenuHomePhorge
Diviner libphutil Tech Docs phutil_validate_json

function phutil_validate_json($value, $path)
libphutil Technical Documentation (Core Utilities)

Produce a human-readable explanation why a value can not be JSON-encoded.

Parameters
wild$valueValue to validate.
string$pathPath within the object to provide context.
Return
string|nullExplanation of why it can't be encoded, or null.