作者 lyh

gx

@@ -441,6 +441,6 @@ function characterTruncation($string,$pattern){ @@ -441,6 +441,6 @@ function characterTruncation($string,$pattern){
441 $result = $matches[1]; 441 $result = $matches[1];
442 return $result; // 输出:这是footer标签的内容 442 return $result; // 输出:这是footer标签的内容
443 } else { 443 } else {
444 - return "未找到匹配的footer标签"; 444 + return [];
445 } 445 }
446 } 446 }
@@ -106,12 +106,14 @@ class BTemplateLogic extends BaseLogic @@ -106,12 +106,14 @@ class BTemplateLogic extends BaseLogic
106 ] 106 ]
107 ); 107 );
108 //字符串截取 108 //字符串截取
109 - $this->param['head_html'] = characterTruncation($this->param['html'], '/<header[^>]*>(.*?)<\/header>/');  
110 - $this->param['main_html'] = characterTruncation($this->param['html'], '/<main[^>]*>(.*?)<\/main>/');  
111 - $this->param['footer_html'] = characterTruncation($this->param['html'], '/<footer[^>]*>(.*?)<\/footer>/');  
112 - $this->param['head_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-header">(.*?)<\/style>/');  
113 - $this->param['main_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-style">(.*?)<\/style>/');  
114 - $this->param['footer_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-footer">(.*?)<\/style>/'); 109 + $this->param['head_html'] = characterTruncation($this->param['html'],'/<header[^>]*>(.*?)<\/header>/');
  110 + var_dump($this->param['head_html']);
  111 + die();
  112 +// $this->param['main_html'] = characterTruncation($this->param['html'],'/<main[^>]*>(.*?)<\/main>/');
  113 +// $this->param['footer_html'] = characterTruncation($this->param['html'],'/<footer[^>]*>(.*?)<\/footer>/');
  114 +// $this->param['head_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-header">(.*?)<\/style>/');
  115 +// $this->param['main_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-style">(.*?)<\/style>/');
  116 +// $this->param['footer_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-footer">(.*?)<\/style>/');
115 if($info === false){ 117 if($info === false){
116 $this->param['project_id'] = $this->user['project_id']; 118 $this->param['project_id'] = $this->user['project_id'];
117 $rs = $this->model->add($this->param); 119 $rs = $this->model->add($this->param);