title: How to remove "ï¿½" from php string?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1488866/how-to-replace-i-in-a-string">How to replace &#239;&#191;&#189; in a string</a>  </p>
  </blockquote>
  
  
  
  <p>I am reading data from an XML sheet coming out of a database. In the raw output I am coming accross this character "ï¿½" which is the UTF-8 string meaning "�". Doing a simple search and remove with str_replace does not do the trick when searching for "�" or "ï¿½". Is there any other way to remove this character from a string?</p>
  
  <p>UPDATE: </p>
  
  <p>For reference this is the function that is cleaning up strings for me.</p>
  
  <pre><code>    function db_utf8_convert($str)
  {
      $convmap = array(0x80, 0x10ffff, 0, 0xffffff);
      return preg_replace('/\x{EF}\x{BF}\x{BD}/u', '', mb_encode_numericentity($str, $convmap, "UTF-8"));
  }
  </code></pre>