Created
June 29, 2019 18:59
-
-
Save jhonsore/37db329655ea7cada597e00b4b90d2d5 to your computer and use it in GitHub Desktop.
Replace non alphanum and - from php string
This file contains hidden or 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
$str = '123 - *&ˆ%$#@ T+=esteJhon#4255%%'; | |
$newStr = preg_replace('/[^[:alnum:]-]/','',$str); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment