php-extended / polyfill-php80-str-utils
PHP8及以上版本中引入的字符串函数的PHP实现
1.3.7
2024-03-31 13:28 UTC
Requires
- php: >=7.3
Requires (Dev)
README
PHP8及以上版本中引入的字符串函数的PHP实现
安装
此库的安装通过composer进行,所有类的自动加载通过其自动加载器完成。
- 从他们的网站下载
composer.phar
。 - 然后运行以下命令将此库作为依赖项安装
php composer.phar require php-extended/polyfill-php80-str-utils: "^1"
基本用法
此库提供以下函数
str_contains(?string $haystack, ?string $needle) : bool
str_icontains(?string $haystack, ?string $needle) : bool
str_starts_with(?string $haystack, ?string $needle) : bool
str_istarts_with(?string $haystack, ?string $needle) : bool
str_ends_with(?string $haystack, ?string $needle) : bool
str_iends_with(?string $haystack, ?string $neede) : bool
这些函数遵循str_ireplace
的命名约定,以及str_contains
的参数放置。
许可证
MIT (见许可证文件)。