Beispiel #1
0
function remover_elemento($array, $elemento)
{
    $k = get_indice($array, $elemento);
    if ($k >= 0 and $k <= count($array) - 1) {
        $p1 = array();
        $p2 = array();
        $p1 = sub_array($array, 0, $k);
        if ($k < count($array) - 1) {
            $p2 = sub_array($array, $k + 1, count($array) - 1);
        }
        array_pop($p1);
        $array = concatenar($p1, $p2);
    }
    return $array;
}
Beispiel #2
0
function view($page, $params = array(), $raw = false)
{
    global $_VIEW;
    if (isset($_VIEW[$page])) {
        needed_params($_VIEW[$page]['params'], $params);
        if (REWRITE_URL && isset($_VIEW[$page]['url_rewrite'])) {
            $base = call_user_func_array($_VIEW[$page]['url_rewrite'], sub_array($_VIEW[$page]['params'], $params));
            $params = array();
        } else {
            $base = $_VIEW[$page]['php_file'];
            $params = sub_array($_VIEW[$page]['params'], $params);
        }
        if ($raw) {
            return array($base, $params);
        } else {
            return build_url($base, $params);
        }
    }
}