Function Print PHP echo
<p>Someone knows what's my wrong code :</p>

<pre><code>$text = str_replace(":-)", "&lt;img src='emoticons/smile.gif'&gt;", $text);
</code></pre>

<p>When I try to print the text using PHP echo, it show :</p>

<pre><code>&lt;img src='emoticons/smile.gif'&gt;
</code></pre>

<p>All I want to do is to show the image when I input :-)</p>

<p>Thank you.</p>

<p>As per details, this is my code below :</p>

<pre><code>function sendChat() {
$from = $_SESSION['username'];
$to = $_POST['to'];
$message = $_POST['message'];

$_SESSION['openChatBoxes'][$_POST['to']] = date('Y-m-d H:i:s', time());

$messagesan = sanitize($message);

if (!isset($_SESSION['chatHistory'][$_POST['to']])) {
    $_SESSION['chatHistory'][$_POST['to']] = '';
}

$_SESSION['chatHistory'][$_POST['to']] .= &lt;&lt;&lt;EOD
                   {
        "s": "1",
        "f": "{$to}",
        "m": "{$messagesan}"
   },
EOD;


unset($_SESSION['tsChatBoxes'][$_POST['to']]);

$sql = "insert into chat (chat.from,chat.to,message,send) values ('".mysql_real_escape_string($from)."', '".mysql_real_escape_string($to)."','".mysql_real_escape_string($message)."',NOW())";
$query = mysql_query($sql);
echo "1";
exit(0);
}

function sanitize($text) {
$text = htmlspecialchars($text, ENT_QUOTES);
$text = str_replace("\n\r","\n",$text);
$text = str_replace("\r\n","\n",$text);
$text = str_replace("\n","&lt;br&gt;",$text);
$text = str_replace(":-)", "&lt;img src='emoticons/13.gif'&gt;", $text);
return $text;
}
</code></pre>
