This is the first time I try something like this and this is what I got using PHP (You'll need another language than HTML to parse and replace the strings for icons). This file should be named
thisfilename.php in order to work and should be run from a server and not as a regular html.
<?php
extract($_POST);
if (!$theinput){}
else {
$trans = array(
":P" => "<img src='P.jpg' />",
"U_U" => "<img src='UU.jpg' />"
);
$theinput= strtr($theinput, $trans);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Replace text with icons</title>
</head>
<body>
<form action="thisfilename.php" method="post">
<textarea name="theinput" cols="80" rows="10px"></textarea>
<input type="submit" value="POST">
</form>
<br />
<br />
The entry was:
<br />
<div id="theoutput"><?php echo $theinput; ?></div>
</body>
</html>
Hope this helps