This URL.php class may be a good start (not sure it is 'widely' accepted though).
URL class intended for http and https schemes
This class allows you store absolute or relative URLs and access it's various parts (scheme, host, port, part, query, fragment).
It will also accept and attempt to resolve a relative URL against an absolute URL already stored.
Note: this URL class is based on the HTTP scheme.
Example:
$url =& new URL('http://www.domain.com/path/file.php?query=blah');
echo $url->get_scheme(),"\n"; // http
echo $url->get_host(),"\n"; // www.domain.com
echo $url->get_path(),"\n"; // /path/file.php
echo $url->get_query(),"\n"; // query=blah
// Setting a relative URL against our existing URL
$url->set_relative('../great.php');
echo $url->as_string(); // http://www.domain.com/great.php