예제 #1
0
function dumprow($fp, $tag, $row)
{
    fwrite($fp, "    <row>\n");
    foreach ($row as $key => $value) {
        fwrite($fp, sprintf("      <%s>%s</%s>\n", $key, encode_value($value), $key));
    }
    fwrite($fp, "    </row>\n");
}
예제 #2
0
function url_for_graph($type, $attributes)
{
    if (!empty($attributes)) {
        $values = array();
        foreach ($attributes as $attribute => $value) {
            $values[] = sprintf('%s=%s', $attribute, encode_value($value));
        }
        $attributes_str = '?' . implode('&', $values);
    } else {
        $attributes_str = null;
    }
    return url_for(sprintf('graph/%s%s', $type, $attributes_str));
}