$url = new Url('http://my-server.com/index.php?p1=foo&p2=bar'); $url->setQueryParameter('param3', 'another value'); echo $url;