# 使用 CodeIgniter 对 URL 进行签名后如何获取字符串?
例子:
http://site.com/controller/function/#bla-bla
# 使用 CodeIgniter 对 URL 进行签名后如何获取字符串?
例子:
http://site.com/controller/function/#bla-bla
您无法通过 PHP或 CI 获取 URL 哈希。
这属于客户端,你应该使用 JavaScript 来实现:
var hash = window.location.hash;
console.log(hash); // "#bla-bla"
您可以通过以下方式删除#字符substr(1):
console.log(hash.substr(1)); // "bla-bla"