本文整理匯總了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;
}
示例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;
}