Created
April 19, 2012 12:52
-
-
Save mapkyca/2420795 to your computer and use it in GitHub Desktop.
Quickly remove non-alpha chars from a string
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
// Quick regexp to remove non-alpha chars from a string. Very handy | |
$string = preg_replace("/[^a-zA-Z0-9\s]/", "", $string); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment