熊猫843/tld-support

TLDDatabase 和 TLDExtract 支持包

1.1.1 2016-06-18 12:28 UTC

This package is auto-updated.

Last update: 2024-09-04 12:46:29 UTC


README

TLDDatabaseTLDExtract提供支持包。本包提供了处理数组、IP地址、字符串等辅助工具。

Build Status Code Climate Test Coverage PHP 7 ready

本包符合PSR-1PSR-2PSR-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

贡献

请参阅CONTRIBUTINGCONDUCT获取详细信息。

许可证

本库采用Apache 2.0许可证发布。有关更多信息,请参阅许可证文件