function bb_code($text) { $text=preg_replace('/\[b\](.+)\[\/b\]/sU' , '<b>\1</b>', $text); $text=preg_replace('/\[i\](.+)\[\/i\]/sU', '<i>\1</i>', $text); $text=preg_replace('/\[u\](.+)\[\/u\]/sU', '<u>\1</u>', $text); $text=preg_replace('/\[s\](.+)\[\/s\]/sU', '<s>\1</s>', $text); $text=preg_replace('/'.preg_quote('[url=').'(.+)\](.+)	 2;[\/url\]/sU', '<a href="\1">\2</a>', $text); $text=preg_replace('/\[url\](.+)\[\/url\]/sU', '<a href="\1">\1</a>', $text); return $text; }
Функция ВВ-кодов
12 лет назад