|
@@ 119-126 (lines=8) @@
|
| 116 |
|
* MODIFY THE RAW CONTENT |
| 117 |
|
*/ |
| 118 |
|
|
| 119 |
|
public function trim_before(string $pattern, bool $is_regex = false): PfPageparser |
| 120 |
|
{ |
| 121 |
|
$found = $is_regex ? preg_match($pattern, $this->content, $matches) : strpos($this->content, $pattern); |
| 122 |
|
if ($found) { |
| 123 |
|
$this->content = substr($this->content, $found); |
| 124 |
|
} |
| 125 |
|
return $this; |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
public function trim_after(string $pattern, bool $is_regex = false): PfPageparser |
| 129 |
|
{ |
|
@@ 128-136 (lines=9) @@
|
| 125 |
|
return $this; |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
public function trim_after(string $pattern, bool $is_regex = false): PfPageparser |
| 129 |
|
{ |
| 130 |
|
$found = $is_regex ? preg_match($pattern, $this->content, $matches) : strpos($this->content, $pattern); |
| 131 |
|
if ($found) { |
| 132 |
|
$this->content = substr($this->content, 0, $found); |
| 133 |
|
} |
| 134 |
|
return $this; |
| 135 |
|
|
| 136 |
|
} |
| 137 |
|
|
| 138 |
|
public function trim(string $before = "<body", string $after = "</body", bool $is_regex = false): PfPageparser |
| 139 |
|
{ |