note 13240 deleted from language.variables.external by didou
| From: | didou@php.net | Date: | Wed, 21 Jan 2004 09:28:53 +0000 |
| Subject: | note 13240 deleted from language.variables.external by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63930@lists.php.net to get a copy of this message | ||
Note Submitter: johnNOSAPMjc@attglobalNOSPAM.net
----
Running PHP from the shell and accessing the command line arguments.
My hosting service has register_argc_argv turned off (now the default) and I had to hunt like hell
to find where the command line parameters are stashed.
They are in $HTTP_GET_VARS and can only be accessed by treating this as an associative array
(looping through it by numbers makes it look as though there's nothing there).
If you try something like this:
"/usr/www/cgi-bin/php4.cgi test.php arg1=abc arg2=def" you will see that the first
argument is appended to the name of your script file (test_php_arg1) and the rest of the command
line is passed through as the _one and only_ argument ("abc arg2=def" is passed through).