oldmine / relative-to-absolute-url
Library adaptation to translate relative url to absolute. Original library: https://sourceforge.net/projects/absoluteurl/
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 2
Open Issues: 0
pkg:composer/oldmine/relative-to-absolute-url
Requires (Dev)
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2025-09-24 10:54:31 UTC
README
This script converts the relative url to absolute url, provided a base url.
For more, look here: http://publicmind.in/blog/urltoabsolute
Usage:
First step - add library to project
Composer (.json)
{
"require": {
"oldmine/relative-to-absolute-url": "master"
}
}
Composer (Command Line)
composer require oldmine/relative-to-absolute-url
Require:
require_once('src/RelativeToAbsoluteUrl.php');
Second step - call static method urlToAbsolute() in class RelativeToAbsoluteUrl
$absoluteUrl = RelativeToAbsoluteUrl::urlToAbsolute('http://test.com/dir1/dir2/', 'test')
Author/credits
- Original author: David R. Nadeau, NadeauSoftware.com
- Edited and maintained by: Nitin Kr, Gupta, publicmind.in
- Edited and maintained by: Daniil Zhelninskiy webmailexec@gmail.com