Default Settings Edit: JSON value detection.

Functions: is_json function added.
This commit is contained in:
Nate Jones
2015-01-24 04:39:17 +00:00
parent 366d1684a8
commit cd80258a0c
2 changed files with 29 additions and 9 deletions

View File

@@ -1241,4 +1241,12 @@ function number_pad($number,$n) {
return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($str_to_dec), MCRYPT_MODE_CBC, md5(md5($key))), "\0");
}
}
//json detection
if (!function_exists('is_json')) {
function is_json($str) {
return (is_string($str) && is_object(json_decode($str))) ? true : false;
}
}
?>