How can I get a variable of a hash in php.
I have a variable on page like this
catalog.php#album=2song=1
How can i get the album and song values and put them into PHP variables?
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.
Just adding onto @Alec’s answer.
There is a
parse_url()function:Which can return
fragment - after the hashmark #. However, in your case it will return all values after the hashmark:As @NullUserException pointed out, unless you have the url beforehand this really is pointless. But, I feel its good to know nonetheless.