Example #1
0
            <div class="column-1-2 input">
                <h3>Input:</h3>
                <form method="post" action="phptoshort.php#output">
                    <input type="text" id="inputText" name="inputText" value="<?php 
echo isset($_POST['inputText']) ? $_POST['inputText'] : 'Hello world! &#x1f604;';
?>
"/>
                    <input type="submit" value="Convert"/>
                </form>
            </div>
            <div class="column-1-2 output">
                <h3>Output:</h3>
                <p>
                    <?php 
if (isset($_POST['inputText'])) {
    echo $client->toShort($_POST['inputText']);
}
?>
                </p>
            </div>
        </div>

        <h3>PHP Snippet:</h3>
        <div class="new-version">As of version 1.4.1 this library method has new syntax.</div>
        <pre class="brush: php">
&lt;?php
    namespace Emojione;

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