I have question that seems simple to you all but can’t really get it. encounter warning till now.
May I know how can i accept a string with integers 0-9 and alpha a-zA-Z but minimum 5 characters and maximum 15 characters with preg_match. Thanks
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.
Try this:
Here
^marks the begin and$the end of the string (the D modifier is to let$match only the end of the line without an ending line break). That means the whole string must be matched by the pattern[0-9a-zA-Z]{5,15}that describes a sequence of 5 to 15 characters of the character class[0-9a-zA-Z].