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