Page 1 of 1

how to pass parameters to a PHP file invoked via the shell

Posted: Thu Oct 19, 2006 10:34 am
by jasongr
Hi people

I need to invoke a php script via the php.exe engine like so:
c:\php\php.exe c:\myfile.php

I would like to be able to send parameters to the myfile.php script.
Can anyone show me the correct syntax to doing this?

regards

Posted: Thu Oct 19, 2006 10:44 am
by feyd
There are several avenues for getting input via the command line. Many choose to use argv and argc.

http://php.net/reserved.variables#reser ... les.server

Posted: Thu Oct 19, 2006 11:29 am
by jasongr
thanks, I will indeed use argv and argc