php check if json

60

php check if json -

function isJson($string) {
 json_decode($string);
 return (json_last_error() == JSON_ERROR_NONE);
}

Comments

Submit
0 Comments