busybee/urljoin
最新稳定版本:1.0.0
Composer 安装命令:
composer require busybee/urljoin
包简介
Library to correctly join relative and absolute URLs
README 文档
README
A PHP library function for joining a base URL and a potentially-relative target URL into an absolute URL
Why isn't this in the PHP standard library? WHO KNOWS.
Installation:
- Direct install: just pull
src/urljoin.phpinto your project - Composer:
composer require busybee/urljoin
usage:
urljoin($base_url, $other_url);
See tests.php for test suite, as well as expected inputs and outputs. (Doing
this correctly is way more complicated thing than you'd think!) This
implementation strives for accuracy and, in cases of ambiguity (such as ../
stack underflow and empty path components), defers to Python's standard library
behavior (as implemented by urlparse.urljoin).
Other things that you might know this as:
- Relative path concatenation
- A function for converting a relative path to an absolute URL given a base URL
rel2absandrelativeToAbsolute(common names for this sort of function)
统计信息
- 总下载量: 18.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-03-07