title: PHP: remove small words from string ignoring german characters in the words
body: <p>I am trying to create slugs for urls.</p>
  
  <p>I have the following test string :</p>
  
  <pre><code>$kw='Test-Tes-Te-T-Schönheit-Test';
  </code></pre>
  
  <p>I want to remove small words less than three characters from this string.</p>
  
  <p>So, I want the output to be </p>
  
  <pre><code>$kw='test-tes-schönheit-test';
  </code></pre>
  
  <p>I have tried this code :</p>
  
  <pre><code>$kw = strtolower($kw);
  $kw = preg_replace("/\b[^-]{1,2}\b/", "-",  $kw);
  $kw = preg_replace('/-+/', '-', $kw);
  $kw = trim($kw, '-');
  echo $kw;
  </code></pre>
  
  <p>But the result is :</p>
  
  <pre><code>test-tes-sch-nheit-test
  </code></pre>
  
  <p>so, the German character ö is getting removed from the string
  and German word Schönheit is being treated as two words.</p>
  
  <p>Please suggest how to solve this.</p>
  
  <p>Thank you very much.</p>