Пример #1
0
<?php

error_reporting(E_ALL);
// set error reporting on
function absUrl($relUrl, $host = 'http://www.myhost.com/')
{
    return $host . $relUrl;
}
echo absUrl('files/uploads/me.jpg');
Пример #2
0
<?php

error_reporting(E_ALL);
// set error reporting on
$host = 'http://www.myhost.com/';
function absUrl($relUrl, $host)
{
    return $host . $relUrl;
}
echo absUrl('files/uploads/me.jpg', $host);