作者 lyh

gx

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