spatie/emoji

Display emoji characters

4.1.1 2024-03-07 06:58 UTC

This package is auto-updated.

Last update: 2024-04-07 07:14:25 UTC


README

Latest Version on Packagist Software License Tests Total Downloads

In PHP, you can display emoji characters just by typing them:

echo "😃";

This package provides some functionality to work with emojis if your IDE or used font can't render them correctly:

Emoji::grinningFace();

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

Support us

68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f656d6f6a692e6a70673f743d31

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Postcardware

You're free to use this package (it's MIT-licensed), but if it makes it to your production environment you are required to send us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

The best postcards will get published on the open source page on our website.

Install

You can install the package via composer:

composer require spatie/emoji

Usage

The Spatie\Emoji\Emoji-class contains character constants that may be used directly:

Emoji::CHARACTER_GRINNING_FACE;

Or you can use the shorter method by leaving off "character" and using camelCase:

Emoji::grinningFace();

If you want to get an array containing all emojis, you can use this method:

Emoji::all();

You can also use an ISO 3166 Alpha2 country code and get the appropriate flag for the country:

Emoji::countryFlag('be'); // 🇧🇪

This package contains Full Emoji List v13.1 based on https://unicode.org/Public/emoji/13.1/emoji-test.txt all methods and constants are auto-generated.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

We are accepting PRs that add characters to the class. Please use this list to look up the unicode value and the name of the character.

Please see CONTRIBUTING for details.

Security

If you've found a bug regarding security please mail security@spatie.be instead of using the issue tracker.

Credits

About Spatie

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

License

The MIT License (MIT). Please see License File for more information.