https://github.com/10quality/php-emoji
Library to convert certain emojis to public svgs (html).
https://github.com/10quality/php-emoji
Last synced: 11 months ago
JSON representation
Library to convert certain emojis to public svgs (html).
- Host: GitHub
- URL: https://github.com/10quality/php-emoji
- Owner: 10quality
- License: mit
- Created: 2017-10-31T23:45:24.000Z (over 8 years ago)
- Default Branch: v1.0
- Last Pushed: 2017-11-07T17:37:33.000Z (over 8 years ago)
- Last Synced: 2025-05-06T13:13:12.769Z (about 1 year ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Emoji
Library to convert certain emojis to public svgs (html).
- [Install](#install)
- [Usage](#usage)
- [Supported Emojis](#supported-emojis)
- [License](#license)
## Install
With composer:
```bash
composer require 10quality/php-emoji
```
## Usage
Using global functions:
```php
// 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:
```php
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
| Emoji | Characters | Emoji | Characters |
| ----- | ---------- | ----- | ---------- |
|  | `<3` |  | `ðŸ’` |
|  | `☕ï¸` |  | `:)` |
|  | `:D` |  | `:(` |
|  | `:'(` |  | `:P` |
|  | `O:)` |  | `o.O` |
|  | `;)` |  | `:O` |
|  | `-_-` |  | `>:O` |
|  | `:*` |  | `^_^` |
|  | `8-)` |  | `8\|` |
|  | `>:(` |  | `☺` |
|  | `(y)` |  | `➡` |
## License
Copyright (c) 2017 [10Quality](http://www.10quality.com/). Under MIT License.