Re: PHP command line vars
| From: | Shawn McKenzie | Date: | Tue, 18 Nov 2003 18:29:57 +0000 |
| Subject: | Re: PHP command line vars | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-170136@lists.php.net to get a copy of this message | ||
Thanks! The link was just what I needed.
-Shawn
"Marek Kilimajer" <kilimajer@webglobe.sk> wrote in message
news:3FBA50F0.9060000@webglobe.sk...
> Shawn McKenzie wrote:
>
> > I have a script that I want to run on the windows command line, and it
is
> > working fine. What I want to do is pass vars to the script when I run
it,
> > example: php script.php $var=hello
> The example will not work, command line arguments are traditionaly
> passed in the form of:
> php script.php --long-name hello
> or
> php script.php -n hello
>
> You will have to parse $argv array to get the command line arguments.
>
> >
> > I have read the docs but can't find the syntax to pass these in. Also,
how
> > to retrieve them in the script? argv other?
>
> http://www.php.net/manual/en/features.commandline.php