Advertisement
colmulhall

Untitled

Apr 3rd, 2014
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Replace unreadable characters from the description (e.g.  )
  2. $string = utf8_decode($string);
  3. $string = iconv("UTF-8", "ISO-8859-1//IGNORE", $string);    // ignore non UTF-8 characters
  4. $temp = utf8_decode('Â');
  5. $string = str_replace($temp, '', $string);   // replace  character with a space
  6. $string = preg_replace('/[^a-zA-Z0-9_ %\[\]\.\(\)%&-]/s', ' ', $string);  // regular expression
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement