diff options
| author | lolcat <will@lolcat.ca> | 2025-07-27 21:46:03 -0400 |
|---|---|---|
| committer | lolcat <will@lolcat.ca> | 2025-07-27 21:46:03 -0400 |
| commit | f43feff0aa5d56ee3f75618cf4ab50fa325e263e (patch) | |
| tree | bd0a1cddb81785aeb9da48e8bffd9f56d72e9a32 /lib/fuckhtml.php | |
| parent | 0bdd5e73df28c570acec49754e2433ec9ac40281 (diff) | |
added baidu, the best search engine
Diffstat (limited to 'lib/fuckhtml.php')
| -rw-r--r-- | lib/fuckhtml.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/fuckhtml.php b/lib/fuckhtml.php index 5b45578..3ea256f 100644 --- a/lib/fuckhtml.php +++ b/lib/fuckhtml.php @@ -240,12 +240,13 @@ class fuckhtml{ public function getElementsByFuzzyAttributeValue(string $name, string $value, $collection = null){ $elems = $this->getElementsByAttributeName($name, $collection); + $value = explode( " ", trim( preg_replace( - '/ +/', + '/\s+/', " ", $value ) @@ -258,7 +259,18 @@ class fuckhtml{ foreach($elem["attributes"] as $attrib_name => $attrib_value){ - $attrib_value = explode(" ", $attrib_value); + $attrib_value = + explode( + " ", + trim( + preg_replace( + '/\s+/', + " ", + $attrib_value + ) + ) + ); + $ac = count($attrib_value); $nc = count($value); $cr = 0; |
