piscibus/php-hashtag

A simple php service for parsing hashtags from a string in any language.

1.1.1 2023-05-30 15:06 UTC

This package is auto-updated.

Last update: 2024-04-30 00:39:45 UTC


README

Latest Version on Packagist Total Downloads CI Packagist PHP Version

This package provides a simple way to extract hashtags from a string in any language.

Installation

You can install the package via composer:

composer require piscibus/php-hashtag

Support us

We invest a lot of resources into creating open source projects. This package is extracted from a bigger project. We are using it in production, and we will continue to maintain it. If you find it useful, please consider supporting us. All kinds of contributions are welcome.

Usage

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']

License

This package is open-sourced software licensed under the MIT license.