View Single Post
Team Leader
30Oct2006,11:23  
pradeep's Avatar
You have to use Regular Expressions (regex) to filter out bad characters.Checkout the exmaple below.

Code: PHP
$string = "Asdsd - sdsd ";
if(!preg_match("/^[\w]+$/",$string))
{
   print("Bad characters found!");
}