0
The following link below has a "hastag".
Example: https://site.com.br/noticia/temer-is-dead#1
I’d like to pay that #1
that is in the url.
This is possible with PHP or Js?
0
The following link below has a "hastag".
Example: https://site.com.br/noticia/temer-is-dead#1
I’d like to pay that #1
that is in the url.
This is possible with PHP or Js?
0
Yes, it is possible.
With the PHP just use the function parse_url
$url = parse_url("https://site.com.br/noticia/temer-is-dead#1");
echo $url["fragment"];
To capture the current URL, complete with JS
console.log(window.location.hash.substr(1));
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
but in this case, the URL is in the address bar. Your answer is valid, I’ll see if I can do something. Thank you!
– user41630
@I edited the answer. I added the code to get the current URL fragment with JS. The fragment is not sent to the server, so there is no way to use PHP.
– Valdeir Psr
worked out, thanks
– user41630