得到了一些似乎不起作用的东西。假设我有一个像
www.test1.php?WC.id=12345
然后下面什么都不返回
$_GET['WC.id'];
如果我卸下马桶。部分,然后它返回 12345。我的 url 参数名称中可以没有句点吗?
谢谢
最佳答案
来自documentation :
It is important to note that PHP will automatically replace any dots in incoming variable names with underscores. [...] PHP irreversibly modifies field names containing these characters in an attempt to maintain compatibility with the deprecated register_globals feature.
The full list of field-name characters that PHP converts to _ (underscore) is the following (not just dot):
chr(32) ( ) (space) chr(46) (.) (dot) chr(91) ([) (open square bracket) chr(128) - chr(159) (various)
因此,您可以使用WC_id
名称访问WC.id
。
关于名称中带点的 PHP GET url 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33126289/