location.hash = $(this).attr("id");
追加ID到URL栏立即无需重新加载。结果是:http://example.net/index.php/abc#id
然后我赞同
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
我得到的输出是:http://example.net/index.php/abc
我怎样才能获得#ID(被称为片段ID)在PHP,以便它可以是用作PHP变量?
谢谢!