echo preg_match("#/login#", "/login/val1-val2/dir2", $matches);
print_r($matches);
I get:
1
Array
(
[0] => /login
)
The strings are not equals, how could I change my regex TO DO NOT 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.
Use this:
#^/login$#. The^and$mark the begining and end of the string. Of course, if that’s your exact use case, you can simply use==to “match” the strings.