|
...
|
...
|
@@ -427,3 +427,21 @@ function isChinese($str) { |
|
|
|
function isEnglish($str) {
|
|
|
|
return preg_match('/^[a-zA-Z]+$/u', $str);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :字符串截取
|
|
|
|
* @name :characterTruncation
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/28 17:39
|
|
|
|
*/
|
|
|
|
function characterTruncation($str,){
|
|
|
|
preg_match('/<main>(.*?)<\/main>/', $str, $matches);
|
|
|
|
|
|
|
|
if (isset($matches[1])) {
|
|
|
|
$result = $matches[1];
|
|
|
|
echo $result;
|
|
|
|
} else {
|
|
|
|
echo "未找到匹配的部分";
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|