Пример #1
0
 public static function json_decode($string, $assoc_array = false)
 {
     if (function_exists('json_decode')) {
         return json_decode($string, $assoc_array);
     } else {
         if (!self::$servicesJSON) {
             require_once WFWAF_LIB_PATH . 'json.php';
             self::$servicesJSON = new wfServices_JSON();
         }
         $res = self::$servicesJSON->decode($string);
         if ($assoc_array) {
             $res = self::_json_decode_object_helper($res);
         }
         return $res;
     }
 }