i wanna try to get the parameters of a link when it’s : separated like below :
http://localhost/index/test:1
How can i get test and its value (1) by php?
Thanks in advance ; )
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.
Like genesis said, it is highly recommended that you change the style of the query. The
?param1=value1¶m2=param2format is industry and technology standard.If you cannot change the query style, instead you can manually parse the request URI.
You can obtain it via
$_SERVER['REQUEST_URI'];and do some parsing using the string functions, such asstrpos.This should be a last resort, however.