Skip to content

Commit 2c452c9

Browse files
committed
add new filter: clearSpace
1 parent 2c26045 commit 2c452c9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Filter/FilterList.php

+12-2
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,20 @@ public static function stripped($val, $flags = 0)
153153
public static function trim($val)
154154
{
155155
return \is_array($val) ? array_map(function ($val) {
156-
return \is_string($val) ? trim($val) : $val;
157-
}, $val) : trim((string)$val);
156+
return \is_string($val) ? \trim($val) : $val;
157+
}, $val) : \trim((string)$val);
158158
}
159159

160+
/**
161+
* clear space
162+
* @param string $val
163+
* @return mixed
164+
*/
165+
public static function clearSpace($val)
166+
{
167+
return str_replace(' ', '', \trim($val));
168+
}
169+
160170
/**
161171
* string to lowercase
162172
* @param string $val

0 commit comments

Comments
 (0)