I have a page at:
http://somewebsite.com/1234/test/
How do I get the 1234 extracted from it with a PHP 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.
I like to avoid regex if I don’t need it, so I would recommend you do it this way:
Then you can reference the part of the url that you want using this:
If you need/want to use regex, I’ll think about it for a second and try to post a solution later.