title: php preg_replace with empty string replacement character does not work on non printable characters
body: <p>I'm trying to remove non printable characters in a string, except some characters that I need.</p>
  <pre><code>$arr = ['Ù', 'é', '€'];
  $string = &quot;é &amp; Ù @ ♣ ☂ % &amp; € À&quot;;
  $acceptedChars = implode('\\', $arr);
  $string = preg_replace('/[^[:print:] ' . $acceptedChars . ']/', '', $string);
  
  echo 'Test : ' . $string;
  </code></pre>
  <p>My issue is that instead of replacing the unwanted characters by an empty string as set in the second parameter, I get this instead :</p>
  <p><a href="https://i.stack.imgur.com/OtppN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OtppN.png" alt="enter image description here" /></a></p>