Limp_Bizkit,
за такое и бан не дадут
Добавлено 19.01.14 в 23:12:13:
а по теме автор вот код
<?php
function bbcode($text){
$bbcode = array(
\'/\\[i\\](.+)\\[\\/i\\]/isU\' => \'<em>$1</em>\',
\'/\\[b\\](.+)\\[\\/b\\]/isU\' => \'<strong>$1</strong>\',
\'/\\[sub\\](.+)\\[\\/sub\\]/isU\' => \'<sub>$1</sub>\',
\'/\\[sup\\](.+)\\[\\/sup\\]/isU\' => \'<sup>$1</sup>\',
\'/\\[del\\](.+)\\[\\/del\\]/isU\' => \'<del>$1</del>\',
\'/\\[u\\](.+)\\[\\/u\\]/isU\' => \'<span style=\"text-decoration:underline;\">$1</span>\',
\'/\\[big\\](.+)\\[\\/big\\]/isU\' => \'<span style=\"font-size:large;\">$1</span>\',
\'/\\[small\\](.+)\\[\\/small\\]/isU\' => \'<span style=\"font-size:small;\">$1</span>\',
\'/\\[code\\](.+)\\[\\/code\\]/isU\' => \'<code>$1</code>\',
\'/\\[red\\](.+)\\[\\/red\\]/isU\' => \'<span style=\"color:#ff0000;\">$1</span>\',
\'/\\[yellow\\](.+)\\[\\/yellow\\]/isU\' => \'<span style=\"color:#ffff22;\">$1</span>\',
\'/\\[green\\](.+)\\[\\/green\\]/isU\' => \'<span style=\"color:#00bb00;\">$1</span>\',
\'/\\[blue\\](.+)\\[\\/blue\\]/isU\' => \'<span style=\"color:#0000bb;\">$1</span>\',
\'/\\[white\\](.+)\\[\\/white\\]/isU\' => \'<span style=\"color:#ffffff;\">$1</span>\',
\'/\\[size=([0-9]+)\\](.+)\\[\\/size\\]/isU\' => \'<span style=\"font-size:$1px;\">$2</span>\',
\'#\\[color=(\\#[0-9A-F]{3,6}|[a-z\\-]+)\\](.*)\\[/color\\]#isU\' => \'<span style=\"color: \\\\1\">\\\\2</span>\',
\'#\\[align=(left|right|center)\\](.*)\\[/align\\]#isU\' => \'<p style=\"text-align: \\\\1\">\\\\2</p>\');
return preg_replace(array_keys($bbcode), array_values($bbcode), $text);
}
?>
и вот еще
<?
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;
}
?>