作者 lyh

gx

... ... @@ -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 "未找到匹配的部分";
}
}
... ...
... ... @@ -35,6 +35,7 @@ class ATemplateLogic extends BaseLogic
* @time :2023/6/28 17:13
*/
public function aTemplateSave(){
//字符串截图
if(isset($this->param['id'])){
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
}else{
... ...