正则匹配成功时才替换掉html
This commit is contained in:
parent
39dc0ca9c6
commit
e4fc716acd
@ -125,8 +125,8 @@ class Query
|
|||||||
*/
|
*/
|
||||||
public function removeHead()
|
public function removeHead()
|
||||||
{
|
{
|
||||||
$html = preg_replace('/(<head>|<head\s+.+?>).+<\/head>/is', '<head></head>', $this->html);
|
$html = preg_replace('/(<head>|<head\s+.+?>).+?<\/head>/is', '<head></head>', $this->html);
|
||||||
$this->setHtml($html);
|
$html && $this->setHtml($html);
|
||||||
return $this->ql;
|
return $this->ql;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user