JoyPixels Labs

version 8.0

shortnameToImage($str)

convert shortnames to images

If you've chosen to unify your inputted text so that it contains only shortnames then this is the function (or its matching Javascript function) you will want to use to convert the shortnames images when displaying it to the client.

Feel free to enter other shortnames in the input below to test the conversion process.

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.

Input:

Output:

PHP Snippet:

        <?php
            // include the PHP library (if not autoloaded)
            require('./../lib/php/autoload.php');

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

            // ###############################################
            # Optional:
            # default is ignore ASCII smileys like :) but you can easily turn them on
            $client->ascii = true;

            # if you want to host the images somewhere else
            # you can easily change the default paths
            $client->imagePathPNG = './assets/png/';
            // ###############################################

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