Created
June 29, 2016 13:09
-
-
Save pjendrusik/156271e62d5925e28fee126613975c45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If the input is utf8-encoded, might use unicode regex to match/strip invisible control characters like e2808e (left-to-right-mark). Use u (PCRE_UTF8) modifier and \p{C} or \p{Other}. | |
Strip out all invisibles: | |
$str = preg_replace('/\p{C}+/u', "", $str); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment