piscibus / php-hashtag
一个简单的php服务,用于从任何语言的字符串中解析标签。
1.1.1
2023-05-30 15:06 UTC
Requires
- php: >=8.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.13
- pestphp/pest: ^1.22
- phpunit/phpunit: ^9.5
- psalm/plugin-phpunit: ^0.18.4
- vimeo/psalm: ^5.4
README
此包提供了一种简单的方法从任何语言的字符串中提取标签。
安装
您可以通过composer安装此包
composer require piscibus/php-hashtag
支持我们
我们投入了大量资源来创建开源项目。此包是从一个更大的项目中提取出来的。我们在生产中使用它,并将继续维护它。如果您觉得它有用,请考虑支持我们。我们欢迎各种形式的贡献。
使用方法
use Piscibus\PhpHashtag\Extractor; $text = 'This is an #English #text with #hashtags'; $hashtags = Extractor::extract($text); // ['English', 'text', 'hashtags'] // Or you can use the helper function $hashtags = extract_hashtags($text); // ['English', 'text', 'hashtags']
许可证
此包是开源软件,许可协议为MIT许可。