BB-code fonksiyonu

tarantula90118.03.2010 - 20:08
Kod: [Seç]
[code]<?
// author: Louai Munajim
// website: http://elouai.com
// date: 2004/Apr/18
function bb2html($text)
{
  $bbcode = array("<", ">",
                "[list]", "[*]", "[/list]",
                "[img]http://", "[/img]",
                "[b]", "[/b]",
                "[u]", "[/u]",
                "[i]", "[/i]",
                '[color="', "[/color]",
                "[size=\"", "[/size]",
                '[url=http://"', "[/url]",


                "[mail=\"", "[/mail]",
                "[code]", "
",
                "
Alıntı
", "
",
                '"]');
  $htmlcode = array("&lt;", "&gt;",
                "<ul>", "<li>", "</ul>",
                "<img src=\"", "\">",
                "", "",
                "", "",
                "", "",
                "<span style=\"color:", "</span>",
                "<span style=\"font-size:", "</span>",
                '<a href="', "[/url]",
                "<a href=\"mailto:", "[/url]",
                "<code>", "</code>",
                "<table width=100% bgcolor=lightgray><tr><td bgcolor=white>", "</td></tr></table>",
                '">');
  $newtext = str_replace($bbcode, $htmlcode, $text);
  $newtext = nl2br($newtext);//second pass
  return $newtext;
} ?>[/code][/code]

Linkback: https://www.buyuknet.com/bbcode-fonksiyonu-t21536.0.html

Etiket:

Bu bilgi size yardimci oldu mu?

EvetHayır
BB-code fonksiyonu
BB-code fonksiyonu
(Ortalama: 5 üzerinden 2.5 - 2 Oy)
2