PHPackages                             10quality/php-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. 10quality/php-emoji

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

10quality/php-emoji
===================

PHP Emoji coverter library.

v1.0.2(8y ago)047MITPHP

Since Nov 1Pushed 8y ago3 watchersCompare

[ Source](https://github.com/10quality/php-emoji)[ Packagist](https://packagist.org/packages/10quality/php-emoji)[ Docs](https://github.com/10quality/php-emoji)[ RSS](/packages/10quality-php-emoji/feed)WikiDiscussions v1.0 Synced 2mo ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

PHP Emoji
=========

[](#php-emoji)

Library to convert certain emojis to public svgs (html).

- [Install](#install)
- [Usage](#usage)
- [Supported Emojis](#supported-emojis)
- [License](#license)

Install
-------

[](#install)

With composer:

```
composer require 10quality/php-emoji
```

Usage
-----

[](#usage)

Using global functions:

```
// Following example will return an svg url
// -- echos 'https://s.w.org/images/core/emoji/2.3/svg/1f497.svg'
echo emoji_to_img('ðŸ’');

// Following example will return an svg wrapped in an image HTML tag
// -- echos ''
echo emoji_to_html('ðŸ’');
```

Using `Emoji` class:

```
use TenQuality\Utility\Emoji;

/**
 * @param string First param is the text you want to convert.
 * @param string Second param is the type of output wanted.
 */
echo Emoji::convert('ðŸ’', Emoji::URL);
echo Emoji::convert('ðŸ’', Emoji::HTML);
```

Supported Emojis
----------------

[](#supported-emojis)

EmojiCharactersEmojiCharacters[![Heart](https://camo.githubusercontent.com/25e2bfcba195b19ba1026ee15ed62652eebbb0668ad736c5f4737b189751c53c/68747470733a2f2f732e772e6f72672f696d616765732f636f72652f656d6f6a692f322e332f7376672f31663439372e737667)](https://camo.githubusercontent.com/25e2bfcba195b19ba1026ee15ed62652eebbb0668ad736c5f4737b189751c53c/68747470733a2f2f732e772e6f72672f696d616765732f636f72652f656d6f6a692f322e332f7376672f31663439372e737667)`
