BBkod fonksiyonu

Nursen

Paylaşımcı Üye
Katılım
24 Nis 2020
Mesajlar
1,046
Beğeniler
5
Kod:
<?php  
    function check_html($string,$res=""){  
        if($res==""){  
            $string=htmlspecialchars ($string);  
            $string = ereg_replace("\n","<br>",$string);  
            $string = ereg_replace("\[b\]","<b>",$string);  
            $string = ereg_replace("\[/b\]","</b>",$string);  
            $string = ereg_replace("\[i\]","<i>",$string);  
            $string = ereg_replace("\[/i\]","</i>",$string);  
            $string = ereg_replace("\[u\]","<u>",$string);  
            $string = ereg_replace("\[/u\]","</u>",$string);  
            $string = ereg_replace("\[codigo\]","<font class=codigo>",$string);  
            $string = ereg_replace("\[fincodigo\]","</font>",$string);  
            $string = ereg_replace("\[link\]","<a href=\"",$string);  
            $string = ereg_replace("\[sep\]","\">",$string);  
            $string = ereg_replace("\[/link\]","<\a>",$string);  
            return($string);  
        }else{  
            $string=htmlspecialchars($string);  
            return($string);  
        }  
    }  
?>
 

Şu anda bu konu'yu okuyan kullanıcılar

Benzer konular

Üst