php-extended/polyfill-php80-str-utils

PHP8及以上版本中引入的字符串函数的PHP实现

1.3.7 2024-03-31 13:28 UTC

This package is auto-updated.

Last update: 2024-08-31 00:43:59 UTC


README

PHP8及以上版本中引入的字符串函数的PHP实现

coverage build status

安装

此库的安装通过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 (见许可证文件)。