Functions - Adjust is_json() function for better detection.

This commit is contained in:
fusionate
2023-07-31 23:27:15 +00:00
parent 3d6c1cbb99
commit ac6d9e5c45

View File

@@ -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;
}
}