Skip to content

Instantly share code, notes, and snippets.

@egulhan
Created August 23, 2014 16:13
Show Gist options
  • Select an option

  • Save egulhan/8019f848ecd6da4b513c to your computer and use it in GitHub Desktop.

Select an option

Save egulhan/8019f848ecd6da4b513c to your computer and use it in GitHub Desktop.
Remove non-ascii characters using PHP
function removeNonAsciiChars($str)
{
return preg_replace('/[[:^print:]]/','',$str);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment