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. ---------------------------------------------------
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php