stichoza/phemoji

PHP Emoji functions and stuff.

v0.1.1 2015-11-28 20:53 UTC

This package is auto-updated.

Last update: 2024-10-17 11:20:55 UTC


README

Latest Stable Version Total Downloads Downloads Month

Emojis in PHP 🐘

Have you ever envied Swift having possibility to use emojis in code? Well, you can use it in PHP too. I mean, it was possible for years. *Shots fired* 💥 🔫

Installation

Install this package via Composer.

composer require stichoza/phemoji

Usage

Getting Started

After you have installed the package, you can just call Phemoji::init() and you're good to go!

\Stichoza\Phemoji\Phemoji::init();

or

namespace App\Http\Controlers\Blabla;

// ...

use Stichoza\Phemoji\Phemoji;

// ...

Phemoji::init();

Note: This will define some constants and functions in global scope. Once called it will be available everywhere. If you're using any PHP framework, it would be more convinient if you call this method somewhere in middleware or routes or any other place you prefer.

Use of emojis

I have not written full docs yet. You can read the source code and you'll get everything what's going on here.

Example:

And so on. Take a look at full list in the source of Phemoji.php

Disclaimer

This package is created just for fun. I am not responsible if any emoji from this package will burn your house to the ground or murder your cute little kitten. Btw, if it ever kills a cat, notify me and I'll remove this repo from Github. I mean Octocat is also a cat.