function tegs($str){
if(!empty($str)){
$tegs = explode(',', $str); $all_tegs = count($tegs); $str_Tegs = '<a href="/tegs.php?search='.input($tegs['0']).'">'.input($tegs['0']).'</a>'; for($i = 1; $i<=$all_tegs-1; $i++){
$str_Tegs .= ', <a href="/tegs.php?search='.input($tegs[$i]).'">'.input($tegs[$i]).'</a>'; } $str = $str_Tegs; } else {
$str = 'Меток нет.'; } return $str;}// Использоватьecho tegs('php', 'mysql');