$body contains my message text:
$body = eregi_replace("😉", '<img src="images/wink.gif" alt="smiley" />', $body);
$body = eregi_replace(";(", '<img src="images/frown.gif" alt="smiley" />', $body);
$body = eregi_replace(";-)", '<img src="images/wink.gif" alt="smiley" />', $body);
$body = eregi_replace(";-(", '<img src="images/frown.gif" alt="smiley" />', $body);
$body = eregi_replace("🙂", '<img src="images/wink.gif" alt="smiley" />', $body);
$body = eregi_replace(":(", '<img src="images/frown.gif" alt="smiley" />', $body);
To replace images links or hyperlinks user adds in their text, simply use the htmlspecialchars() function.
To search for specific tekst, like [link]:
$body = ereg_replace("[LINK]([[LINK]]*)[LINK]", "<a href=\"\1\"><\1</a>", $body);
Last one I'm not sure ;-) Perhaps this phpbuilder forum also escapes some text, so perhaps it doesn't make sense ;-)