11 Kasım 2014, 05:02
#1 Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
kodların içindeki CDATA, script, style, code taglarını ve içeriklerini silmek
PHP Kod: Kodu kopyalamak için üzerine çift tıklayın!
<?
function stripLargeTags ( $html ){
$searches = array (
"/<!\[CDATA\[(.*)\]\]>/si" , // Remove CData
"/<script[^>]*>.*?<\/script>/si" , // Strip out javascript
"/<style[^>]*>.*?<\/style>/si" , // Strip out styles
"/<code[^>]*>.*?<\/code>/si" , // Strip out code chunks
"/<!--.*?-->/s" , // Strip comments
"/<!.*>/Us" , // Strip !Tags
"/<\?.*>/Us" // Strip !Tags
);
$replace = array();
foreach( $searches as $search ){
array_push ( $replace , '' ); // Replace all with ''
} reset ( $searches );
$text = preg_replace ( $searches , $replace , $html );
return $text ;
}
?>
__________________
Bu kez pek bir afili yalnızlık, ağlatan bir kadın kadar düşman. Ağzı bozuk üstelik bırakmıyor acıtmadan.