Hello,
I would like to filter a string and strip all characters that are not alphanumeric or a hyphen. Is there some tunction in PHP for that?
Not sure how to do it.
Hello,
I would like to filter a string and strip all characters that are not alphanumeric or a hyphen. Is there some tunction in PHP for that?
Not sure how to do it.
you could use a regular expression to search for such strings and then replace them with the empty string. The expression could look like: [^a-zA-Z0-9\-]
See preg_replace