I have an array with 5 single chars. They shall be checked with this regex:
$regex = "/[a-zA-Z0-9]/";
How can I check if the single chars are allowed?
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.
You can use preg_grep that accepts an array as well:
As per the doc: preg_grep returns the array consisting of the elements of the input array that match the given pattern.
Then you can do: