Bir metin içerisindeki tüm html etiketlerini temizleyen ve sadece asıl metni ortaya çıkaran PHP fonksiyonu.
<!--?php // -------------------------------------------------------------- function rip_tags($string) { // ----- remove HTML TAGs ----- $string = preg_replace ('/<[^>]*>/', ' ', $string); // ----- remove control characters ----- $string = str_replace("\r", '', $string); // --- replace with empty space $string = str_replace("\n", ' ', $string); // --- replace with space $string = str_replace("\t", ' ', $string); // --- replace with space // ----- remove multiple spaces ----- $string = trim(preg_replace('/ {2,}/', ' ', $string)); return $string; } // -------------------------------------------------------------- ?>
Bir önceki yazımız olan Yazılım sürecinde test etme ve kullanılabilirlik. başlıklı makalemizde algoritma, kiss ve yazılım süreci hakkında bilgiler verilmektedir.
Leave reply