是否有与 Perl 的 URI::ParseSearchString 等效的 PHP 语言?
我正在为客户做一些工作,涉及解析来自 Google 等人的引用信息,以将页面的各个部分定位到用户的搜索关键字。
我注意到 Perl 的 CPAN 有一个名为 URI:: ParseSearchString 似乎完全符合我的需要。问题是,我需要用 PHP 来做。
那么,为了避免重新发明轮子,有谁知道是否有一个 PHP 库可以做相同/类似的事情?
I'm doing some work for a client that involves parsing the referrer information from Google et al to target various parts of a page to the user's search keywords.
I noticed that Perl's CPAN has a module called URI::ParseSearchString which seems to do exactly what I need. The problem is, I need to do it in PHP.
So, to avoid reinventing the wheel, does anyone know if there is a library out there for PHP that does the same / similar thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
parse_str()
就是您要查找的内容为了。您可能还想使用
parse_url()
获取搜索字符串。parse_str()
is what you are looking for.You may additionally want to use
parse_url()
to get the search string.我是该模块的作者。据我所知,我从未见过 PHP 有类似的东西。如果您遇到任何情况,请告诉我。
话虽这么说,我无法想象这很难移植到 PHP,如果您没有找到类似的东西,我可以尝试一下。
斯皮罗斯
I'm the author of the module. As far as I know, I've never seen something similar for PHP. If you do come across anything, please do let me know.
That being said, I cannot image this being very hard to port to PHP and I can have an attempt at it if you dont find anything similar out there.
Spiros
也许这效率太低或者 http_referer 没有显示完整的 uri ...
Maybe this is too inefficient or the http_referer isn't showing the full uri ...