php提取英文

/**
 * 提取英文
 * @param $srchKeyword
 */
function getEN($srchKeyword){
	$preg_repOne = array('/[-][a-zA-Z][0-9]/i', '/[0-9]/i', '/[a-zA-Z][0-9][-]/i', '/[^\[0-9]da-zA-Z]/i', '/\(|\)/', '/\《|\》/', '/\+|\-|\*|\//' , '/\{|\}/', '/\<|\>/', '/\【|\】/', '/\[|\]/', '/\(|\)/'
	);
	$preg_repTwo = array(' ',
	PHP_EOL,
    '-', '\'', '/', '\\', '[', ']', '{', '}', 'è', 'β', '±', '^', '’', '~', '-', '+', '.', '。', '\'', '#', '@', '!', '&', '*', '<', '>', '%', 'α', 'γ', 'ε', '', '<i>', '</i>' , '[', ']', '-', 'δ', '+', '【', '】', '#', ';', '\\r', '\′', '′', '(', ')', '(', ')', ',', '_');
	$str = preg_replace($preg_repOne, array('', ''), $srchKeyword);
	$str = str_replace($preg_repTwo, array('', ''), $str);
	$str = mb_substr($str, 0, 255, 'utf-8');
	return strtolower($str);
}


分类: PHP 点赞(0) 收藏

评论