Functions - Adjust is_json() function for better detection.
This commit is contained in:
parent
3d6c1cbb99
commit
ac6d9e5c45
|
|
@ -1484,7 +1484,7 @@ function number_pad($number,$n) {
|
|||
//json detection
|
||||
if (!function_exists('is_json')) {
|
||||
function is_json($str) {
|
||||
return (is_string($str) && is_object(json_decode($str))) ? true : false;
|
||||
return is_string($str) && is_array(json_decode($str, true)) ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue