在url [duplicate]中获取哈希标记#后的所有内容

I have a url like this http://example.com/?hello=1234

using this

   ob_start();
   var_dump($_GET);
   $result = ob_get_clean();
   print_r($result);

i get this

 array(1) {
 ["hello"]=>
 string(3) "123"
 }

but when it comes to http://example.com/#hello=1234 im getting nothing. i know that # is for client side/browser but is there any way to get everything after the # (hash tag) ?

</div>

The URL fragment is not sent to the server at all.

You can access it in client-side Javascript using location.hash.

You either have to parse the url using parse_url() or use javascript instead window.location.hash

var hash = location.hash.slice(1) in JavaScript will get you everything after the #.

For http://example.com/#hello=1234 var hash would be hello=1234