Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php strip out special characters

function clean($string) {
   $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.

   return preg_replace('/[^A-Za-z0-9-]/', '', $string); // Removes special chars.
}
 
PREVIOUS NEXT
Tagged: #php #strip #special #characters
ADD COMMENT
Topic
Name
7+9 =