donnikitos/url
Composer 安装命令:
composer require donnikitos/url
包简介
PHP URL class to parse, construct, normalize, and encode URLs - but just like in JavaScript
关键字:
README 文档
README
The URL class is used to parse, construct, normalize, and encode URLs. It works by providing properties which allow you to easily read and modify the components of a URL.
You normally create a new URL object by specifying the URL as a string when calling its constructor, or by providing a relative URL and a base URL. You can then easily read the parsed components of the URL or make changes to the URL.
Instance properties
hash
A string containing the fragment identifier of the URL.
host
A string containing the domain (that is the hostname) followed by (if a port was specified) a ':' and the port of the URL.
hostname
A string containing the domain of the URL.
href
A stringifier that returns a string containing the whole URL.
origin
Returns a string containing the origin of the URL, that is its scheme, its domain and its port.
password
A string containing the password specified before the domain name.
pathname
A string containing an initial '/' followed by the path of the URL, not including the query string or fragment.
port
A string containing the port number of the URL.
protocol
A string containing the protocol scheme of the URL.
search
A string indicating the URL's parameter string; if any parameters are provided, this string includes all of them.
searchParams
A URLSearchParams object which can be used to access the individual query parameters found in search.
username
A string containing the username specified before the domain name.
Instance methods
toString()
Returns a string containing the whole URL. It is a synonym for URL.href, though it can't be used to modify the value.
toJSON()
Returns a JSON string containing a serialized version of the URL object.
URLSearchParams
The URLSearchParams interface defines utility methods to work with the query string of a URL.
Instance properties
size
Indicates the total number of search parameter entries.
Instance methods
append(string $name, string | int | bool $value)
Appends a specified key/value pair as a new search parameter.
delete(string $name, null | string | int | bool $value = null)
Deletes search parameters that match a name, and optional value, from the list of all search parameters.
entries()
Returns an iterator allowing iteration through all key/value pairs contained in this object in the same order as they appear in the query string.
get(string $name)
Returns the first value associated with the given search parameter.
has(string $name)
Returns a boolean value indicating if a given parameter, or parameter and value pair, exists.
keys()
Returns an iterator allowing iteration through all keys of the key/value pairs contained in this object.
set(string $name, string | int | bool $value)
Sets the value associated with a given search parameter to the given value. If there are several values, the others are deleted.
toString()
Returns a string containing a query string suitable for use in a URL.
values()
Returns an iterator allowing iteration through all values of the key/value pairs contained in this object.
donnikitos/url 适用场景与选型建议
donnikitos/url 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 101 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 08 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「url」 「parse url」 「URLSearchParams」 「URL-API」 「URLSearchParams-API」 「url processing」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 donnikitos/url 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 donnikitos/url 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 donnikitos/url 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
yii2 xml request parser
Parse promotion arrays from the Wayne State University API
Parse use statements for a reflection object
Makes the algorithms and APIs defined by URL Standard (replaces RFC 3986 and RFC 3987) available on PHP. / URL Standard (RFC 3986、RFC 3987 を置き換える Web 標準仕様) で定義されているアルゴリズム、および API を PHP から利用できるようにします。
Easy URL rewrites in your Laravel application
Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js
统计信息
- 总下载量: 101
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-15