我有Ubuntu 10.10和apache2,php 5.3.3-1和mysql 5.1。
我正在通过URL向页面传递一些值。在该页面上,如果我这样做了print_r($_GET),那么我会看到数组的内容。但是,如果我这样做print_r($_REQUEST)数组是空的。任何想法为什么会这样?
print_r($_GET)
print_r($_REQUEST)
也可以尝试检查php.ini中的“ request_order”选项:
; This directive determines which super global data (G,P,C,E & S) should ; be registered into the super global array REQUEST. If so, it also determines ; the order in which that data is registered. The values for this directive are ; specified in the same manner as the variables_order directive, EXCEPT one. ; Leaving this value empty will cause PHP to use the value set in the ; variables_order directive. It does not mean it will leave the super globals ; array REQUEST empty. ; Default Value: None ; Development Value: "GP" ; Production Value: "GP" ; http://php.net/request-order request_order = "GP"