peterpostmann/resolve_uri
Composer 安装命令:
composer require peterpostmann/resolve_uri
包简介
Resolves relative urls, like a browser would
README 文档
README
Resolves relative urls, like a browser would.
This function returns a new URI based on base path (RFC3986 URL, URN, Windows path, relative path or file) and a new path.
Install
Via Composer
composer require peterpostmann/resolve_uri
If you dont want to use composer copy the resolve_uri.php file and from [peterpostmann\php-parse_uri][2] the parse_uri.php file and include it into your project.
Usage
use function peterpostmann\uri\resolve_uri; string resolve_uri ( string basePath, string newPath)
Example
parse URIs
use function peterpostmann\uri\resolve_uri; echo resolve_uri('http://a/b/c/d;p?q#x', 'x')."\n"; echo resolve_uri('C:\path\file1.ext', 'file2.ext')."\n"; echo resolve_uri('file://smb/path/to/file', '/new/path/x.ext')."\n";
The above example will output:
http://a/b/c/x C:\path\file2.ext file://smb/new/path/x.ext
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 47
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-17