Re: Is it possible to pass arguements when using PHP before 4.3.n?[SOLVED]
| From: | Marek Kilimajer | Date: | Thu, 13 May 2004 15:37:27 +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-186108@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]Use -q if you don't want the headers: /usr/local/bin/php -q mySmallScript.php foo.php