Made the pattern in the first regex an utf-8 pattern, otherwise it could fail

This commit is contained in:
pezcurrel 2024-10-29 18:27:56 +01:00
parent 97964f8237
commit 55211ce5bf

View file

@ -1,7 +1,7 @@
<?php
function hashtag($str,$ucfirst=true) {
$str=preg_replace('#^\W*(.*)\W*$#','$1',$str);
$str=preg_replace('#^\W*(.*)\W*$#u','$1',$str);
$str=preg_split('#\W+#u',$str);
$c=count($str);
if ($c>1) {