Skip to content

Instantly share code, notes, and snippets.

@coreh
Created February 23, 2011 17:56
Show Gist options
  • Save coreh/840819 to your computer and use it in GitHub Desktop.
Save coreh/840819 to your computer and use it in GitHub Desktop.
// Ele tirava todos os caracteres que não fossem alfa e aspas
$_q = preg_replace('/[^A-Za-z\']/i', '', $_REQUEST['query']);
// Agora ele tira todos que não forem alfa ou espaços, e corta os espaços do começo e do final.
// Preciso lidar com os acentos e tals ainda
$_q = preg_replace('/[^A-Za-z\'\s]/i', '', trim($_REQUEST['query']));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment