Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 11 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
假设您的意思是提交表单后,则不会,仅将参数名称和值发送到服务器。您可以巧妙地命名以在服务器端识别它们。然后,您可以在服务器上迭代请求变量并从名称中解析
chk
。例如:HTML
PHP
但是,如果您事先不知道类型,那么在服务器上获取变量会变得更加困难。
Assuming you mean after submitting the form, then no, only the parameter name and value are sent to the server. You could be a little clever with your naming to identify them server-side. At the server, you can then iterate over the request variables and parse
chk
from the name. For example:HTML
PHP
It makes it harder to get the variables at the server, though, if you don't know the type beforehand.
是的,您可以使用 HTML 解析器 并获取输入元素的类型属性。
将输出“文本”。
SO 有很多涉及获取不同部分的示例。只需搜索一下即可。
Yes, you can use an HTML parser and fetch the input element's type attribute.
will output "text".
There is plenty of examples on SO that cover fetching different parts. Just give it a search.
到达 PHP 的唯一数据类型是字符串和数组,因此不可能直接执行此操作。
在我看来,你只有两个选择:
The only data types that reach PHP are strings and arrays, so it's not possible to do that directly.
The way I see it you only have two options: