<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class XKeywordsUtil { public static function match($hnXpY, $cgjRu, &$ctAgl = null) { goto euGbN; E8t9R: foreach ($ttiXA as $ZpLX1) { goto js4rW; js4rW: $ZpLX1 = trim($ZpLX1); goto HSvUe; ooPJw: if (false !== strpos($cgjRu, $ZpLX1)) { $ctAgl = $ZpLX1; return true; } else { if (substr($ZpLX1, 0, 1) === '@') { if (@preg_match('/' . substr($ZpLX1, 1) . '/', $cgjRu)) { $ctAgl = $ZpLX1; return true; } } else { if (false !== strpos($ZpLX1, ' ')) { goto zQGfo; adart: if ($p2PDV) { $ctAgl = $ZpLX1; return true; } goto Ll6AZ; zQGfo: $p2PDV = true; goto v3mxa; v3mxa: foreach (explode(' ', $ZpLX1) as $plrwN) { if (false === strpos($cgjRu, $plrwN)) { $p2PDV = false; break; } } goto adart; Ll6AZ: } else { if (preg_match('/((\\*)(\\d+))[^\\d]/', $ZpLX1, $eG2e9)) { goto IzcZI; MjAO1: if (@preg_match($naPBP, $cgjRu)) { $ctAgl = $ZpLX1; return true; } goto x9us9; DxsEk: $naPBP = '/' . preg_quote($X63Q2[0]) . '.{3,' . $eG2e9[3] * 3 . '}' . preg_quote($X63Q2[1]) . '/'; goto MjAO1; IzcZI: $X63Q2 = explode($eG2e9[1], $ZpLX1); goto DxsEk; x9us9: } else { if (false !== strpos($ZpLX1, '*')) { goto rmpHM; i8ty3: if (@preg_match($naPBP, $cgjRu)) { $ctAgl = $ZpLX1; return true; } goto lfNBx; TtDNc: $naPBP = '/' . preg_quote($X63Q2[0]) . '.+' . preg_quote($X63Q2[1]) . '/'; goto i8ty3; rmpHM: $X63Q2 = explode('*', $ZpLX1); goto TtDNc; lfNBx: } } } } } goto WgLKm; HSvUe: if (empty($ZpLX1)) { continue; } goto ooPJw; WgLKm: } goto NA7cX; G6pu_: $ttiXA = str_replace(',', '
', $hnXpY); goto rfOFP; NA7cX: return false; goto frl9F; WVG0P: if (empty($hnXpY) || empty($cgjRu)) { return false; } goto G6pu_; euGbN: $hnXpY = trim($hnXpY); goto WVG0P; rfOFP: $ttiXA = explode('
', $ttiXA); goto E8t9R; frl9F: } public static function descriptionHtml() { return '<pre class=\'ub-content-bg\'>' . self::description() . '</pre>'; } public static function description() { $fF8o4 = '关键词匹配说明
· 简单包含匹配: "你好" 匹配 "你好"多条使用,分割
· 忽略顺序同时包含匹配: "你 好" 匹配 "你们好"、"你们好"、"很好你们"
· 顺序同时包含匹配: "你*好" 匹配 "你们好"、"你们很好"，*匹配一个或多个字
· 顺序限定同时包含匹配: "你*1好" 匹配 "你们好"，不能匹配"你们很好"，数字表示最长多少个汉字字符，1个汉字=3英文字母
· 正则表达式匹配："@正则表达式" 匹配 "正则表达式"，@开头表示正则表达式
使用说明
· 多个正则使用半角逗号(,)或换行分割'; return $fF8o4; } public static function test() { goto VZVY5; VZVY5: $G8WGc = array('你好', '你好', '你好', '你们好', '你 好', '你们好', '你*好', '你们好', '你*1好', '你们好', '你*1好', '你们很好', '你*2好', '你们很好', '@你们', '你们很好', '@你好', '你们很好'); goto vjguJ; vjguJ: $Of2_w = array(); goto KyJZo; KQIvu: return join('
', $Of2_w); goto UYZuz; KyJZo: for ($UCcmA = 0; $UCcmA < count($G8WGc); $UCcmA += 2) { $Of2_w[] = sprintf('%-10s%-20s%s', $G8WGc[$UCcmA], $G8WGc[$UCcmA + 1], json_encode(self::match($G8WGc[$UCcmA], $G8WGc[$UCcmA + 1]))); } goto KQIvu; UYZuz: } }