PHPackages                             maximal/emoji - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. maximal/emoji

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

maximal/emoji
=============

Emoji Detecting and Processing with no dependencies

v1.7(3y ago)689.8k—1.5%1MITPHPPHP ^7.0|^7.1|^7.2|^7.3|^7.4|^8.0|^8.1|^8.2

Since Jan 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/maximal/emoji-php)[ Packagist](https://packagist.org/packages/maximal/emoji)[ RSS](/packages/maximal-emoji/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)DependenciesVersions (10)Used By (0)

Emoji Detecting and Processing
==============================

[](#emoji-detecting-and-processing)

Unicode version: 15.0.

Installation
------------

[](#installation)

Install this library using the [Composer](https://getcomposer.org) `require` command:

```
composer require maximal/emoji '^1.0'
```

or add the package name to the `require` section of your `composer.json` file:

```
"require": {
	"maximal/emoji": "^1.0"
}

```

and then run:

```
composer update
```

Then include Composer autoload anywhere in your code:

```
require_once __DIR__ . '/vendor/autoload.php';
```

Usage
-----

[](#usage)

```
use Maximal\Emoji\Detector;

// Whether the given string contains emoji characters
$isEmojiFound = Detector::containsEmoji($string);
// 'test' -> false
// 'test 👍' -> true

// Whether the given string consists of emoji characters only
$isEmojiOnly = Detector::onlyEmoji($string);
// 'test 👍' -> false
// '👍😘' -> true

// String without any emoji character
$stringWithoutEmoji = Detector::removeEmoji($string);
// 'test 👍' -> 'test '
// '👍😘' -> ''

// All emojis of the string
$allEmojis = Detector::allEmojis($string);
// 'test 👍' -> ['👍']
// '👍😘' -> ['👍', '😘']

// Starting emojis of the string
$startingEmojis = Detector::startingEmojis($string);
// '👍😘 test' -> ['👍', '😘']
// 'test 👍' -> []
```

### `containsEmoji($string): bool`

[](#containsemojistring-bool)

Detects whether the given string contains one or more emoji characters.

### `onlyEmoji($string, $ignoreWhitespace = true): bool`

[](#onlyemojistring-ignorewhitespace--true-bool)

Detects whether the given string consists of emoji characters only.

This method ignores any spaces, tabs and other whitespace characters (`\s`). Pass `false` to the second parameter for not ignoring whitespace characters.

### `removeEmoji($string): string`

[](#removeemojistring-string)

Returns the given string with all emoji characters removed.

### `allEmojis($string): array`

[](#allemojisstring-array)

Returns an array of all emojis of the input string.

### `startingEmojis($string, $ignoreWhitespace = true): array`

[](#startingemojisstring-ignorewhitespace--true-array)

Returns an array of starting emojis of the input string.

This method ignores any spaces, tabs and other whitespace characters (`\s`). Pass `false` to the second parameter for not ignoring whitespace characters.

Tests
-----

[](#tests)

Run simple tests:

```
php test/tests.php
```

Expected output:

```
Tests total:  119
        run:  119
  succeeded:  119
     failed:  0

```

Contact the author
------------------

[](#contact-the-author)

- Website:  (Russian)
- Twitter:
- Telegram:
- Sijeko Company:  (web, mobile, desktop applications development and graphic design)
- Personal GitHub:
- Company’s GitHub:

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~152 days

Recently: every ~96 days

Total

9

Last Release

1110d ago

PHP version history (4 changes)v1.0PHP ^7.0

v1.3PHP ^7.0|^8.0|^8.1

v1.5.1PHP ^7.0|^8.0|^8.1|^8.2

v1.6PHP ^7.0|^7.1|^7.2|^7.3|^7.4|^8.0|^8.1|^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/980679?v=4)[MaximAL](/maintainers/maximal)[@maximal](https://github.com/maximal)

---

Top Contributors

[![maximal](https://avatars.githubusercontent.com/u/980679?v=4)](https://github.com/maximal "maximal (13 commits)")

---

Tags

detectiondetectoremojiemoji-searcheremojisphpphp-libphp-libraryphp7

### Embed Badge

![Health badge](/badges/maximal-emoji/health.svg)

```
[![Health](https://phpackages.com/badges/maximal-emoji/health.svg)](https://phpackages.com/packages/maximal-emoji)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
