title: php mysql: delete a special character from the database
body: <p>I sometimes import data from CSV files that were provided to me, into a mysql table.</p>
  
  <p>In the last one I did, some of the entries has a weird bad character in front of the actual data, and it got imported in my database. Now I'm looking for a way to clean it up.</p>
  
  <p>The bad data is in the mysql column 'email', it seems to be always right in front of the actual data. When trying to print it on my screen using PHP, it shows up as �. When exporting it to a CSV file, it looks like Â , and if I <code>SET CHARACTER SET utf8</code> before printing it on the screen using PHP, it looks like a normal space ' '.</p>
  
  <p>I was thinking of writing a PHP script that goes over all my rows one at a time, fix the email address field, and update the row. However I'm not quite sure about the "fix the email" part!</p>
  
  <p>I was thinking maybe to do a "explode" and use the bad character as a delimiter, but I don't know how to type that character into my code.</p>
  
  <p>Is there maybe a way to find the underlying value/utf8/hex or whatever of that character, then find it in the string?</p>
  
  <p>I hope it's clear enough.</p>
  
  <p>Thanks</p>
  
  <p>EDIT:
  In Hex, it looks like it's A0. What can I do to search and delete a character by its hex value? Either in PHP or directly in MySQL I guess ...</p>