diff options
Diffstat (limited to 'lib/JSON/inc_json.php')
-rw-r--r-- | lib/JSON/inc_json.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/JSON/inc_json.php b/lib/JSON/inc_json.php new file mode 100644 index 0000000..b36c2a4 --- /dev/null +++ b/lib/JSON/inc_json.php @@ -0,0 +1,22 @@ +<?php + +if (!function_exists('json_decode')) { + function json_decode($content, $assoc=false) { + require_once 'lib/JSON/JSON.php'; + if ($assoc) { + $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); + } + else { + $json = new Services_JSON; + } + return $json->decode($content); + } +} + +if (!function_exists('json_encode')) { + function json_encode($content) { + require_once 'lib/JSON/JSON.php'; + $json = new Services_JSON; + return $json->encode($content); + } +} |