作者 lyh

gx

@@ -427,3 +427,21 @@ function isChinese($str) { @@ -427,3 +427,21 @@ function isChinese($str) {
427 function isEnglish($str) { 427 function isEnglish($str) {
428 return preg_match('/^[a-zA-Z]+$/u', $str); 428 return preg_match('/^[a-zA-Z]+$/u', $str);
429 } 429 }
  430 +
  431 +/**
  432 + * @remark :字符串截取
  433 + * @name :characterTruncation
  434 + * @author :lyh
  435 + * @method :post
  436 + * @time :2023/6/28 17:39
  437 + */
  438 +function characterTruncation($str,){
  439 + preg_match('/<main>(.*?)<\/main>/', $str, $matches);
  440 +
  441 + if (isset($matches[1])) {
  442 + $result = $matches[1];
  443 + echo $result;
  444 + } else {
  445 + echo "未找到匹配的部分";
  446 + }
  447 +}
@@ -35,6 +35,7 @@ class ATemplateLogic extends BaseLogic @@ -35,6 +35,7 @@ class ATemplateLogic extends BaseLogic
35 * @time :2023/6/28 17:13 35 * @time :2023/6/28 17:13
36 */ 36 */
37 public function aTemplateSave(){ 37 public function aTemplateSave(){
  38 + //字符串截图
38 if(isset($this->param['id'])){ 39 if(isset($this->param['id'])){
39 $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); 40 $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
40 }else{ 41 }else{