當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CSearch::RemovePHP方法代碼示例

本文整理匯總了PHP中CSearch::RemovePHP方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSearch::RemovePHP方法的具體用法?PHP CSearch::RemovePHP怎麽用?PHP CSearch::RemovePHP使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CSearch的用法示例。


在下文中一共展示了CSearch::RemovePHP方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: KillTags

	public static function KillTags($str)
	{
		$str = CSearch::RemovePHP($str);

		static $search = array (
			"'<!--.*?-->'si",  // Strip out javascript
			"'<script[^>]*?>.*?</script>'si",  // Strip out javascript
			"'<style[^>]*?>.*?</style>'si",  // Strip out styles
			"'<select[^>]*?>.*?</select>'si",  // Strip out <select></select>
			"'<head[^>]*?>.*?</head>'si",  // Strip out <head></head>
			"'<tr[^>]*?>'",
			"'<[^>]*?>'",
			"'([\\r\\n])[\\s]+'",  // Strip out white space
			"'&(quot|#34);'i",  // Replace html entities
			"'&(amp|#38);'i",
			"'&(lt|#60);'i",
			"'&(gt|#62);'i",
			"'&(nbsp|#160);'i",
			"'[ ]+ '",
		);

		static $replace = array (
			"",
			"",
			"",
			"",
			"",
			"\r\n",
			"\r\n",
			"\\1",
			"\"",
			"&",
			"<",
			">",
			" ",
			" ",
		);

		$str = preg_replace ($search, $replace, $str);

		return $str;
	}
開發者ID:nycmic,項目名稱:bittest,代碼行數:42,代碼來源:search.php

示例2: KillTags

 function KillTags($str)
 {
     $str = CSearch::RemovePHP($str);
     static $search = array("'<!--.*?-->'si", "'<script[^>]*?>.*?</script>'si", "'<style[^>]*?>.*?</style>'si", "'<select[^>]*?>.*?</select>'si", "'<head[^>]*?>.*?</head>'si", "'<tr[^>]*?>'", "'<[^>]*?>'", "'([\\r\\n])[\\s]+'", "'&(quot|#34);'i", "'&(amp|#38);'i", "'&(lt|#60);'i", "'&(gt|#62);'i", "'&(nbsp|#160);'i", "'[ ]+ '");
     static $replace = array("", "", "", "", "", "\r\n", "\r\n", "\\1", "\"", "&", "<", ">", " ", " ");
     $str = preg_replace($search, $replace, $str);
     return $str;
 }
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:8,代碼來源:search.php


注:本文中的CSearch::RemovePHP方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。