<?php
function smile($text)
{
	$q_smile  = mysql_query("SELECT `img`,`value` FROM `smiles`");
		while($sm = mysql_fetch_assoc($q_smile)){
		$text = str_replace($sm['value'],'<img src="img/smiles/'.$sm['img'].'" alt="'.$sm['value'].'">',$text);
		}
		return $text;
	/*include 'smile_array.php';
 	return str_replace(array_keys($smile),array_values($smile),$text);*/
}
?>