Skip to content

Instantly share code, notes, and snippets.

@eyecandy91
Created October 2, 2019 14:24
Show Gist options
  • Save eyecandy91/802290a454ef3751d8eb62a897d43c91 to your computer and use it in GitHub Desktop.
Save eyecandy91/802290a454ef3751d8eb62a897d43c91 to your computer and use it in GitHub Desktop.
remove all special characters from php string
$string = preg_replace('/[^a-zA-Z0-9_ -]/s','',$term->name); //$term->name change what string you need to change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment