php 带有 GET 参数的 URL 格式?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5998425/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
URL format with GET parameters?
提问by mikew
Is there a specification somewhere listing the correct way to pass GET variables to a URL?
是否有某处的规范列出了将 GET 变量传递给 URL 的正确方法?
Normally I do it like this (first variable indicated by ?, second and subsequent indicated by &:
通常我是这样做的(第一个变量用 ? 表示,第二个和后续变量用 & 表示:
http://www.mysite.com/mypage.html?var1=value1&var2=value2&var3=value3
Are those ? and & specifically needed, and in those order? Could I eliminate the '?' and pass all variables only with the '&' ?
那些?和 & 特别需要,按那些顺序?我可以消除'?' 并仅使用 '&' 传递所有变量?
采纳答案by Dustin Laine
No, how you are doing it is correct.
不,你怎么做是正确的。
http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.2
http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2.2