熊猫843 / 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许可证发布。有关更多信息,请参阅许可证文件。