Answers for "check if a variable is a json php"

PHP
2

php check if json

function isJson($string) {
 json_decode($string);
 return (json_last_error() == JSON_ERROR_NONE);
}
Posted by: Guest on April-09-2020

Code answers related to "check if a variable is a json php"

Browse Popular Code Answers by Language