heartsentwined/url
Composer 安装命令:
composer require heartsentwined/url
包简介
A collection of url-related functions.
关键字:
README 文档
README
A collection of url-related functions.
Installation
{
"require": {
"yalesov/url": "2.*"
}
}
Usage
Turn a URL, relative or absolute, into an absolute URL:
use Yalesov\Url\Url; $url = Url::toAbsolute($baseUrl, $relativeUrl);
Filter out . and .. segments from URL's path:
use Yalesov\Url\Url; $path = Url::removeDotSegments($path);
Split a URL to its components: (reverse of Url::join())
use Yalesov\Url\Url; $parts = Url::split($url); // one or more of the following keys may be present: // $parts['scheme'] = (scheme, such as "http") // $parts['host'] = (host name, IPv4, or IPv6 address) // $parts['port'] = (the port number) // $parts['user'] = (user name) // $parts['pass'] = (user password) // $parts['path'] = (path, e.g. a file path for "http") // $parts['query'] = (the query) // $parts['fragment'] = (the fragment)
Join together URL components to form a complete URL: (reverse of Url::split())
use Yalesov\Url\Url; $url = Url::join(array( 'scheme' => $scheme, 'host' => $host, 'port' => $port, 'user' => $user, 'pass' => $pass, 'path' => $path, 'query' => $query, 'fragment' => $fragment, ));
统计信息
- 总下载量: 510
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: ISC
- 更新时间: 2012-09-08