我有一个PHP应用程序,有时必须处理URL中的多个参数具有相同名称的URL.是否有一种简单的方法来检索给定密钥的所有值?PHP $ _GET仅返回最后一个值.
为了使这个具体,我的应用程序是一个OpenURL解析器,可能会得到这样的URL参数:
ctx_ver=Z39.88-2004
&rft_id=info:oclcnum/1903126
&rft_id=http://www.biodiversitylibrary.org/bibliography/4323
&rft_val_fmt=info:ofi/fmt:kev:mtx:book
&rft.genre=book
&rft.btitle=At last: a Christmas in the West Indies.
&rft.place=London,
&rft.pub=Macmillan and co.,
&rft.aufirst=Charles
&rft.aulast=Kingsley
&rft.au=Kingsley, Charles,
&rft.pages=1-352
&rft.tpages=352
&rft.date=1871
Run Code Online (Sandbox Code Playgroud)
(是的,我知道这很难看,欢迎来到我的世界).请注意,键"rft_id"出现两次:
rft_id=info:oclcnum/1903126rft_id=http://www.biodiversitylibrary.org/bibliography/4323$_GET只返回http://www.biodiversitylibrary.org/bibliography/4323,早期的值(info:oclcnum/1903126)已被覆盖.
我想要访问这两个值.这可能在PHP?如果没有,有关如何处理这个问题的任何想法?