No need to check as str_replace will replace everything it matches, only check if the post isn't empty.
<?php
if($_POST['textarea_name']!=""){
$text = $_POST['textarea_name'];
$chatText = str_replace(":D","<img src='happy.jpg' width='20' height='20' alt='Big Smile' />",$text);
echo $chatText;
}
?>
Check this out for more detailed replacement using arrays;