innmind/url-resolver

将相对URL解析为绝对URL的库

5.1.0 2023-09-16 15:03 UTC

This package is auto-updated.

Last update: 2024-09-16 17:01:24 UTC


README

Build Status codecov Type Coverage

允许从源URL和目标URL构建绝对URL。

示例

use Innmind\UrlResolver\UrlResolver;
use Innmind\Url\Url;

$resolve = UrlResolver::of('http', 'https');

$url = $resolve(
    Url::of('http://example.com/foo/'),
    Url::of('./bar/baz?query=string#fragment'),
);
// $url resolves to http://example.com/foo/bar/baz?query=string#fragment