且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用PHP / Symfony在URL中获得#part

更新时间:2023-11-19 21:24:10

您无法通过PHP来获取它,因为它从未传输到服务器。

You can't get it through PHP because it's never transmitted to the server.

不过,您可以使用JavaScript来获取它通过 window.location.hash ,然后通过AJAX将其传输到服务器。

You can, however, get it with JavaScript via window.location.hash, then transmit it to the server via AJAX.