<?php
function smile($text)
{
global $dbc;
$q_smile  = $dbc->query("SELECT `img`,`value` FROM `smiles`");
while($sm=$q_smile->fetch_assoc()){
		$text = str_replace($sm['value'],'<img src="img/smiles/'.$sm['img'].'" alt="'.$sm['value'].'">',$text);
		}
		return $text;
}
?>