比如有这样的一个HTTP的GET请求:
http://ask.segmentfault.com/api?state.code=16
PHP会自动把$_REQUEST["state.code"]转义为$_REQUEST["state_code"]
官方有这样的一个说明:
Dots and spaces in variable names are converted to underscores. For example becomes $_REQUEST["a_b"].
因为后端存储用的是MongoDB,所以希望能查询json内嵌的的数据,所以希望支持“点”这种方式的查询。针对这种问题应该如何解决呢?
顺便说下,PHP的Web Framework用的是Laravel。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
光阴似箭催人老,日月如移越少年。