From e30cfcddbe7d80c30bed367a8fd370defcafe0ff Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 18 Sep 2023 16:09:04 +0200 Subject: [PATCH] wait #6286 @0.5 --- src/Text.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/Text.php b/src/Text.php index c90d0a5..dc0e149 100644 --- a/src/Text.php +++ b/src/Text.php @@ -283,7 +283,7 @@ class Text $str = self::deaccent($str); $str = preg_replace('/[^A-Za-z0-9_\s\'\:\/[\]-]/', '', $str); - return self::tidyURL($str, true,false); + return self::tidyURL($str, true, false); } @@ -948,4 +948,27 @@ class Text return $res; } + /** + * @param $sep string + * @param $str string + * @param $trim string + * @return array + */ + public static function trimExplode($sep, $str, $trim = "\n\r\n\0\x0B") + { + $str = trim($str, $trim); + if (!$str) { + return []; + } + $res = []; + $e = explode($sep, $str); + foreach ($e as $v) { + $v = trim($v, $trim); + if ($v) { + $res[] = $v; + } + } + return $res; + } + } \ No newline at end of file -- 2.39.5