Giter Club home page Giter Club logo

php-emoji's Introduction

php-emoji - Process Emoji in PHP and display them as HTML

This is a PHP library for dealing with mobile device Emoji.

You can read more about it and see a demo here:
http://code.iamcal.com/php/emoji/

It is based on a Ruby library here:
http://www.bitcontrol.org/2009/10/18/emoji-rubygem-for-iphone-softbank-ntt-docomo-kddi/

And data from Unicode here:
http://www.unicode.org/~scherer/emoji4unicode/snapshot/full.html

Important note: As of iOS 6, the iPhone uses unified codepoints. You no longer need to do any conversion at input/output time, unless you want to convert it to HTML for viewing on PCs, Android phones, older Macs, etc.

USAGE

<?php
    include('emoji.php');


    # when you recieve text from a mobile device, convert it
    # to the unified format.

    $data = emoji_docomo_to_unified($data);   # DoCoMo devices
    $data = emoji_kddi_to_unified($data);     # KDDI & Au devices
    $data = emoji_softbank_to_unified($data); # Softbank & pre-iOS6 Apple devices
    $data = emoji_google_to_unified($data);   # Google Android devices


    # when sending data back to mobile devices, you can
    # convert back to their native format.

    $data = emoji_unified_docomo($data);   # DoCoMo devices
    $data = emoji_unified_kddi($data);     # KDDI & Au devices
    $data = emoji_unified_softbank($data); # Softbank & pre-iOS6 Apple devices
    $data = emoji_unified_google($data);   # Google Android devices


    # when displaying data to anyone else, you can use HTML
    # to format the emoji.

    $data = emoji_unified_to_html($data);

    # if you want to use an editor(i.e:wysiwyg) to create the content, 
    # you can use html_to_unified to store the unified value.

    $data = emoji_html_to_unified(emoji_unified_to_html($data));
?>

When using the HTML format, you'll also need to include the emoji.css file, which points to the emoji.png image. These images come from the gemoji project and cover all current codepoints, except U+1F320, Shooting Star.

IMPORTANT NOTE: This library currently only deals with UTF-8. If your source data is JIS or Shift-JIS, you're out of luck for the moment.

CREDITS

By Cal Henderson [email protected]

Parser rewrite based on a fork by 杜志刚

This work is licensed under the GPL v3

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

Version 1 released on 2009-10-20

php-emoji's People

Contributors

iamcal avatar albertoleal avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.