$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);
}
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