Skip to content

Instantly share code, notes, and snippets.

@j0k3r
Created July 31, 2011 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j0k3r/1116875 to your computer and use it in GitHub Desktop.
Save j0k3r/1116875 to your computer and use it in GitHub Desktop.
removes these fsckin' cp-1252 characters from $text
<?php
// from @ubermuda: https://twitter.com/#!/ubermuda/status/85465832217518080
preg_replace('/[^(\x20-\x7F)]+/', '', $text);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment