I can get it to remove all the question marks with the code below:
preg_replace('/(\?+)/', '', $string)
No matter what I seem to do I can’t get it to also remove all the minus signs as well. Everything I try just breaks the whole regex.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Either use a string replace, or:
That will remove any question marks or dashes (minus signs) from your input. Easier to extend to more characters than string replacement, since you can simply add the new character inside the square bracket and be done.