为什么$ _REQUEST为空

Haw*_*eye 16 php arrays request

我有Ubuntu 10.10与apache2,php 5.3.3-1和mysql 5.1.

我将一些值传递给url中的页面.在那个页面上,如果我执行print_r($ _ GET),我会看到数组内容,但如果我执行print_r($ _ REQUEST),则数组为空.这可能是什么想法?

谢谢.

Pau*_*ulP 12

另请尝试检查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"
Run Code Online (Sandbox Code Playgroud)

  • 嗨PaulP,我和Hawkseye有同样的问题,但我在我的php.ini文件中发现request_order已经设置为"GP",并且variables_order也设置为"GPCS".我没有做任何改变.我重新启动了PHP服务器,但仍然无法正常工作.我正在使用nginx 1.4.4和PHP 5.5.8 for windows.谢谢. (2认同)