IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası

IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası (https://www.ircforumlari.net/)
-   PHP (https://www.ircforumlari.net/php/)
-   -   kodların içindeki CDATA, script, style, code taglarını ve içeriklerini silmek (https://www.ircforumlari.net/php/643915-kodlarin-icindeki-cdata-script-style-code-taglarini-ve-iceriklerini-silmek.html)

hAte 11 Kasım 2014 05:02

kodların içindeki CDATA, script, style, code taglarını ve içeriklerini silmek
 
PHP- Kodu:

<?
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;
}
?>



Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 03:20.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2025 IRCForumlari.Net Sparhawk