JoyPixels Labs

version 6.6


convert ASCII characters to shortnames

Our recommendation is to unify all user inputted text by converting native unicode emoji, such as those inputted by mobile devices, to their corresponding shortnames. This demo shows you how to use the toShort($str) PHP function provided in our toolkit to do just that.

Feel free to enter native unicode emoji in the input below to test the conversion process. For a complete list of emoji and their shortnames check out

Note: Once you start dealing with native unicode characters server side, it's important to ensure that your web stack is set up to handle UTF-8 character encoding. That is outside of the scope of our demos, but a quick Google Search will guide you in the right direction.



PHP Snippet:

As of version 1.4.1 this library method has new syntax.
            namespace JoyPixels;

            // include the PHP library (if not autoloaded)

            $client = new Client(new Ruleset());

            if(isset($_POST['inputText'])) {
              echo $client->toShort($_POST['inputText']);