Hi there everyone!
I use a function to strip everything but letters, numbers and spacers for safe part numbers and am having a problem. I thought it would also strip / (and \ ) but it's leaving it.
Here's my function:
function leavealnumspacers( $string ) {
return preg_replace( "/[^a-z0-9 -_]/i", "", $string );
}
and when I check the output, it's leaving slashes in the string. I thought looking at it that it would only allow - and _. How should I modify the function to disallow all special characters but those two in addition to the letters and numbers?
Thanks for your time!