比如有这样的一个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。
回复内容: 比如有这样的一个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。
http://ask.segmentfault.com/api?rq[state.code]=16/** php **/$_get['rq']['state.code'];
在数组内是不会被转的,虽然麻烦了点,不过不失为一种解法…