Re: Assigning command line vars in script

From: Date: Wed, 19 Nov 2003 00:39:41 +0000
Subject: Re: Assigning command line vars in script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-170210@lists.php.net to get a copy of this message
I guess it's the greatest ever, that leaves everyone speechless ;-) -Shawn "Shawn McKenzie" <nospam@mckenzies.net> wrote in message news:20031118191423.13772.qmail@pb1.pair.com... > Does this look like a good way to retrieve command line variables and assign > them in a script, or am I reinventing something that is already in place??? > > for ($i = 1; $i < $argc; $i = $i + 2) { > $var = str_replace("-", "", $argv[$i]); > $$var = $argv[$i+1]; > } > > Thanks! > -Shawn

« previous php.general (#170210) next »