PHP Classes

PHP Emoji Converter: Convert Emoji to plain text or from HTML

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 376 All time: 6,758 This week: 95Up
Version License PHP version Categories
emoji-php-static 1.0.0The PHP License5HTML, PHP 5, Text processing
Description 

Author

This package can convert Emoji to plain text or from HTML.

It can takes a text string with text emojis and converts it to HTML using special emoji Unicode characters.

The class can also convert the HTML with emojis to text with emojis using combinations of characters.

Picture of Nic Latyshev
Name: Nic Latyshev <contact>
Classes: 6 packages by
Country: Russian Federation Russian Federation
Age: 49
All time rank: 300782 in Russian Federation Russian Federation
Week rank: 195 Up9 in Russian Federation Russian Federation Up
Innovation award
Innovation award
Nominee: 2x

Documentation

Emoji-PHP-Static - Conversion Emoji in PHP from Unified <--> HTML

This is a PHP library for conversion Emoji from some mobile phones (iOS & Android) to html code and back

Based on <a href="https://github.com/iamcal/php-emoji">php-emoji</a> by Cal Henderson

USAGE

<?php
    include('Emoji.class.php');
    # or use some AutoLoader which you like

    # when you recieve text from a mobile device, convert it
    # to the HTML (through Unified, Emoji or Unified -> Unified -> HTML)

    $text = Emoji::emoji_to_html($text);

    # when sending data back to mobile devices, you can
    # convert back to Unified format ( HTML -> Unified )

    $text = Emoji::html_to_emoji($text);
?>

When using the HTML format, you'll also need to include the <code>emoji.css</code> file, which points to the <code>emoji.png</code> image. These images come from the <a href="https://github.com/github/gemoji">gemoji</a> project and cover all current codepoints.

Also i'm add another way of conversion - Emoji to HTML-Entity (like &#x1F33A;) and back for use with downloadable web-font from <a href="http://emojisymbols.com/faq.php">emojisymbols.com</a>. This way is best way for edit (or delete, khe-khe) Emoji in textarea on desktop browsers

USAGE

<?php
    include('Emoji.class.php');
    # or use some AutoLoader which you like

    # when you recieve text from a mobile device, convert it
    # to the HTML-Entity (through Unified, Emoji or Unified -> Unified -> HTML-Entity)

    $text = Emoji::emoji_to_font($text);

    # when sending data back to mobile devices, you can
    # convert back to Unified format ( HTML-Entity -> Unified )

    $text = Emoji::font_to_emoji($text);
    
    # this way best way for edit (delete :-)) Emoji in textarea on desktop system
?>

IMPORTANT NOTE: This library currently only deals with UTF-8.

CREDITS

Static class by Nic Latyshev <nickyx3@gmail.com>

Based on <a href="https://github.com/iamcal/php-emoji">php-emoji</a> by Cal Henderson <cal@iamcal.com>

This work is dual-licensed under the GPL v3 and the MIT license.

Image copyrights: https://github.com/github/gemoji/blob/master/LICENSE

Version 1 released on 2015-10-10


  Files folder image Files (5)  
File Role Description
Plain text file Emoji.class.php Class Class source
Accessible without login Plain text file emoji.css Data Auxiliary data
Accessible without login Image file emoji.png Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:376
This week:0
All time:6,758
This week:95Up