PHP: How to resolve a relative url

Perhaps this article could help? http:// nashruddin.com/PHP_Script_for_Converting_Relative_to_Absolute_URL Edit: reproduced code below for convenience <?php function rel2abs($rel, $base) { /* return if already absolute URL */ if (parse_url($rel, PHP_URL_SCHEME) != ” || substr($rel, 0, 2) == ‘//’) return $rel; /* queries and anchors */ if ($rel[0]==’#’ || $rel[0]==’?’) return $base.$rel; /* parse base URL and convert … Read more