Skip to content

Instantly share code, notes, and snippets.

@anunay
Created June 12, 2013 23:01
Show Gist options
  • Save anunay/5769881 to your computer and use it in GitHub Desktop.
Save anunay/5769881 to your computer and use it in GitHub Desktop.
PHP: Strip Non-Alphanumeric Chars from a String
<?php
$string = preg_replace("/[^a-z0-9]+/i", "", $string);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment