Hi Everyone!
I don't understand the question. The question is:
"When PHP is running on a command line, what super-global will contain the command line arguments specified?"
And the answer is $_SERVER. But why? Where's the catch?
I made some tests. In command line I wrote this:
user@user-n:~$ php -f /home/user/public.html.com/filename.php 1arg 2arg 3arg 4arg '5arg'
filename.php
var_dump($argv);
var_dump($GLOBALS["argv"]);
var_dump($_SERVER["argv"]);
All of the above give me the same output:
array(6) {
[0] =>
string(60) "/home/user/public.html.com/filename .php"
[1] =>
string(4) "1arg"
[2] =>
string(4) "2arg"
[3] =>
string(4) "3arg"
[4] =>
string(4) "4arg"
[5] =>
string(4) "5arg"
}
Please give me helpful hints.
Thanks in advance.