layershifter / tld-support
该包已被放弃,不再维护。没有推荐替代包。
TLDDatabase 和 TLDExtract 的支持包
1.1.1
2016-06-18 12:28 UTC
Requires
- php: >=5.5
- symfony/polyfill-mbstring: ^1.2
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phpmd/phpmd: @stable
- phpunit/phpunit: 4.8.*
- squizlabs/php_codesniffer: 2.*
README
为 TLDDatabase 和 TLDExtract 提供支持包。此包提供处理数组、IP 地址、字符串等辅助工具。
该包符合 PSR-1、PSR-2、PSR-4。如果您发现任何不符合之处,请通过 pull request 发送补丁。
要求
以下版本的 PHP 受支持。
- PHP 5.5
- PHP 5.6
- PHP 7.0
- HHVM
使用
数组
mixed Arr::first(array $haystack, null|callable $callback, mixed $default); mixed Arr::last(array $haystack, null|callable $callback, mixed $default);
IP 地址
bool IP::isValid(string $hostname);
字符串
bool Str::endsWith(string $haystack, string|array $needles); int Str::length(string $value); string Str::lower(string $value); string Str::substr(string $string, int $start, int|null $length = null); bool Str::startsWith(string $haystack, string|array $needles); bool|int Str::strpos(string $haystack, string $needles, int $offset = 0); bool|int Str::strrpos(string $haystack, string $needles, int $offset = 0);
混合
mixed Mixed::value(mixed $value);
安装
通过 Composer
$ composer require layershifter/tld-support
测试
$ composer test
贡献
请参阅 CONTRIBUTING 和 CONDUCT 了解详细信息。
许可证
此库在 Apache 2.0 许可证下发布。有关更多信息,请参阅 许可证文件。