Adding emoticon to comments but not working
<p>I have been trying to add emoticons in comments but it is not working, and I have no idea why.</p>

<pre><code>Parse error: syntax error, unexpected T_STRING in /home/content/---------------------------/cdn/postdisplay.php on line 1
</code></pre>

<p>Full php which i include and load to display comments.</p>

<pre><code>&lt;?php
function smiliess($text) {
        $smilies = array(
            '&gt;:('        =&gt;  '&lt;img src="image/icon/angry.png" alt="angry" class="icon_smile1" /&gt;',
            '(angry)'    =&gt;  '&lt;img src="image/icon/angry.png" alt="angry" class="icon_smile2" /&gt;',
            '(Angry)'    =&gt;  '&lt;img src="image/icon/angry.png" alt="angry" class="icon_smile3" /&gt;',
            '(ANGRY)'    =&gt;  '&lt;img src="image/icon/angry.png" alt="angry" class="icon_smile4" /&gt;',
            'B|'         =&gt;  '&lt;img src="image/icon/cool.png" alt="cool" class="icon_smile5" /&gt;',
            '(cool)'     =&gt;  '&lt;img src="image/icon/cool.png" alt="cool" class="icon_smile6" /&gt;',
            '(Cool)'     =&gt;  '&lt;img src="image/icon/cool.png" alt="cool" class="icon_smile7" /&gt;',
            '(COOL)'     =&gt;  '&lt;img src="image/icon/cool.png" alt="cool" class="icon_smile8" /&gt;',    
            // more smiley
        );  
    foreach ($smilies as $search =&gt; $replace)
        $text = preg_replace("#(?&lt;=\s|^)" . preg_quote($search) . "#", $replace, $text);
    return $text;
}
$CheckQuery = mysql_query("SELECT * FROM t_comment WHERE got='$user-&gt;id' ORDER BY `id` DESC LIMIT 0 , 20");
while($row = mysql_fetch_assoc($CheckQuery))
{
    $toolsp = new UserTools();
    $post = $toolsp-&gt;get($row['send_id']);  
    $yourText = $row['content'];
    $yourdisplay = smiliess( $yourText );
    echo '&lt;div class="mycomment"&gt;
        &lt;div id="postpic"&gt;
            &lt;img id="profile_pic" width="50px" height="150px" src="' . $post-&gt;image . '" class="" /&gt;
        &lt;/div&gt;
        &lt;div class="mycommentpost"&gt;                     
            &lt;a class="postername" href="profile.php?userID=' . $post-&gt;id . '"&gt;' . $post-&gt;fname . ' ' . $post-&gt;lname . ': &lt;/a&gt;&lt;br /&gt;
            ' . $yourdisplay . '
        &lt;/div&gt;
    &lt;/div&gt;';
}
?&gt;
</code></pre>

<p>It works fine when i remove emoticon code from php.</p>
