I am trying to create slugs for urls.

I have the following test string :

```
$kw='Test-Tes-Te-T-Schönheit-Test';

```

I want to remove small words less than three characters from this string.

So, I want the output to be 

```
$kw='test-tes-schönheit-test';

```

I have tried this code :

```
$kw = strtolower($kw);
$kw = preg_replace("/\b[^-]{1,2}\b/", "-",  $kw);
$kw = preg_replace('/-+/', '-', $kw);
$kw = trim($kw, '-');
echo $kw;

```

But the result is :

```
test-tes-sch-nheit-test

```

so, the German character ö is getting removed from the string
and German word Schönheit is being treated as two words.

Please suggest how to solve this.

Thank you very much.