BBCODE php
Page 1 of 1
BBCODE php
- Code:
<?
function bbcode($text)\{
$text = str_replace('<', '<', $text);
$text = str_replace('>', '>', $text);
$text = str_replace(''', ''', $text);
$text = str_replace('\[b]', '<b>', $text);
$text = str_replace('\[/b]', '</b>', $text);
$text = str_replace('\[i]', '<i>', $text);
$text = str_replace('\[/i]', '</i>', $text);
$text = str_replace('\[u]', '<u>', $text);
$text = str_replace('\[/u]', '</u>', $text);
$text = str_replace('\[url=', '<a href='', $text);
$text = str_replace('\[/url]', '</a>', $text);
$text = str_replace('\[img]', '<img src='', $text);
$text = str_replace('\[/img]', ''>', $text);
$text = str_replace('\[c]', '<center>', $text);
$text = str_replace('\[/c]', '</center>', $text);
$text = str_replace(']', ''>', $text);
$text = str_replace('\[B]', '<b>', $text);
$text = str_replace('\[/B]', '</b>', $text);
$text = str_replace('\[I]', '<i>', $text);
$text = str_replace('\[/I]', '</i>', $text);
$text = str_replace('\[U]', '<u>', $text);
$text = str_replace('\[/U]', '</u>', $text);
$text = str_replace('\[URL=', '<a href='', $text);
$text = str_replace('\[/URL]', '</a>', $text);
$text = str_replace('\[IMG]', '<img src='', $text);
$text = str_replace('\[/IMG]', ''>', $text);
$text = str_replace('\[C]', '<center>', $text);
$text = str_replace('\[/C]', '</center>', $text);
$text = str_replace(']', ''>', $text);
$text = nl2br($text);
$text = trim($text);
return $text;
\}
?>
<br><font face='Tahoma'><a target='_blank' href='http://www.freecodescript.com/'><span style='font-size: 8pt; text-decoration: none'>Free Code Script</span></a></font>
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum