irm/include/functions.php
// Parse a provided URL and add the extra arguments given as an assoc. array
Parse a provided URL and add the extra arguments given as an assoc. array
Parse a provided URL and add the extra arguments given as an assoc . array
function appendURLArguments($baseURL, $newargs)
{
    preg_match('/^([^?]+)\??(.*)$/', $baseURL, $matches);
    $URL = $matches[1];
    parse_str($matches[2], $argarray);
    foreach ($newargs as $f => $v)
    {
        $argarray[$f] = $v;
    }
    $args = array();
    foreach ($argarray as $f => $v)
    {
        $args[] = urlencode($f)."=".urlencode($v);
    }
    return $URL . "?" . join('&', $args);
}
function appendURLArguments ( $ baseURL , $ newargs ) { preg_match ( '/^([^?]+)\??(.*)$/' , $ baseURL , $ matches ) ; $ URL = $ matches [ 1 ] ; parse_str ( $ matches [ 2 ] , $ argarray ) ; foreach ( $ newargs as $ f => $ v ) { $ argarray [ $ f ] = $ v ; } $ args = array ( ) ; foreach ( $ argarray as $ f => $ v ) { $ args [ ] = urlencode ( $ f ) . " = " . urlencode ( $ v ) ; } return $ URL . " ? " . join ( '&' , $ args ) ; }
Parse a provided URL and add the extra arguments given as an assoc.
Parse a provided URL and add the extra arguments given as an assoc .
// Now reassemble