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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 23:08:38  来源:igfitidea点击:

URL format with GET parameters?

phphttp

提问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