- var_dump: documentation ( source)
- parse_url: documentation ( source)
- header: documentation ( source)
<?php
header('Content-type: text/plain');
$url = 'http://www.example.com';
$rel = ':22/path/to/somewhere?query=string#fragment';
var_dump(parse_url($rel), parse_url($url . $rel));