If I run the PHP interpreter like this
php some.php something
Can I get the "something" like I get it with static void Main(string[] args) on other language?
Thanks.
Printable View
If I run the PHP interpreter like this
php some.php something
Can I get the "something" like I get it with static void Main(string[] args) on other language?
Thanks.
It's $_SERVER['argv']
You can use $argv for the argument values, and $argc for the argument count. :)
Yes, as long as register_argc_argv is on.Quote:
Originally Posted by RudiVisser
Using $_SERVER is preferable as you can rely on that being available.
I've never seen a server of which that isn't available, plus it's enabled by default and there's no reason to change it.