Пример #1
0
    }
    if (is_string($s)) {
        return preg_replace("@([-])@e", "sprintf('\\\\u%04X',ord('\$1'))", str_replace("", '\\u0000', utf8_decode(json_encode(utf8_encode($s)))));
    }
    if ($s === false) {
        return 'false';
    }
    if ($s === true) {
        return 'true';
    }
    if (is_array($s)) {
        $c = 0;
        foreach ($s as $k => &$v) {
            if ($k !== $c++) {
                foreach ($s as $k => &$v) {
                    $v = indicia_json_encode((string) $k) . ':' . indicia_json_encode($v);
                }
                return '{' . join(',', $s) . '}';
            }
        }
        return '[' . join(',', array_map('indicia_json_encode', $s)) . ']';
    }
    return 'null';
}
$method = $_GET['method'];
$arguments = $_GET['arguments'];
$arguments = json_decode($arguments, true);
$f = new phpFlickr(helper_config::$flickr_api_key, helper_config::$flickr_api_secret, true);
$response = $f->call($method, $arguments);
// Dump out the response as JSON
echo indicia_json_encode($response);