Re: Is it possible to pass arguements when using PHP before 4.3.n?[SOLVED]

From: Date: Thu, 13 May 2004 16:44:20 +0000
Subject: Re: Is it possible to pass arguements when using PHP before 4.3.n?[SOLVED]
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-186117@lists.php.net to get a copy of this message
Jay Blanchard wrote:
Is it possible to pass arguements when using PHP before 4.3.n when doing command line stuff? I have built a small script that opens a file, reads from it, and returns some results. Instead of changing the fopen line each time I would just like to pass the name of the file to be tested. I tried as a URL /usr/local/bin/php mySmallScript.php?n=foo.php Didn't work. Wait... Heck. Works fine if you do not mind the headers. $argv and $argc are the answers. /usr/local/bin/php mySmallScript.php foo.php foo.php will be in $argv[1] test_cli.php
-------------------------------------- <?php print( $_REQUEST["test"] ); ?> php -aq test_cli.php test=foo # prints "foo" HTH, Ryan Briones

« previous php.general (#186117) next »