0

My URL is like

http://mysite.in/some_path/some_file.php#section1

Now i want to get the value "section1" which is after # symbol in the URL

i first tried using PHP ,

$last_value = explode('#',$_SERVER['REQUEST_URI']); 
$last = $last_value[sizeof($last_value)-1];

But it echo

/some_path/some_file.php

Later i found that it can't be achieved using PHP .

Kindly help in guiding how to get the last value in the URL after # symbol using JavaScript

EDIT:

The Hint of @Perumal93 from the comment helped me to search for method using JavaScript

The following URL helped me achieving that by using JavaScript

https://stackoverflow.com/a/23563760/3185747

Community
  • 1
  • 1
Raja Gopal
  • 1,845
  • 1
  • 17
  • 34

0 Answers0