Re: Passing args to a PHP script from the command line

From: Date: Thu, 10 Jun 2004 13:40:01 +0000
Subject: Re: Passing args to a PHP script from the command line
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-188041@lists.php.net to get a copy of this message
You may also want to check out PEAR::Console_Getopt http://pear.php.net/package/Console_Getopt Phil Ewington - 43 Plc wrote:
Hi All, Can anyone tell me how to pass arguments to a PHP script from the command line? I know I need to use the -args option but how exactly, I have tried the following... /usr/bin/php myscript.php -args key=value but this does not work, the script executes but key is not available as $_GET["key"] in my script. Any pointers will be much appreciated.
-- Regards, Ben Ramsey http://benramsey.com --------------------------------------------------- http://www.phpcommunity.org/ Open Source, Open Community Visit for more information or to join the movement. ---------------------------------------------------

« previous php.general (#188041) next »