You are here: C97net • 5.01 General Functions
Get real URL from a full URL based on relative path
function real_url ($absolute, $relative)
You can get the real URL from $absolute URL, combined with $relative path.
Example 1
<?php
require './includes/user_init.php';
$absolute = "http://www.c97.net/folder/test/page.php?a=1&b=2&c=2";
$relative = '../..';
// result: http://www.c97.net/folder/
echo real_url ($absolute, $relative);
?>
There is no comment. Why not be the first?