note 56928 modified in features.commandline by joey
| From: | joey@php.net | Date: | Tue, 12 Feb 2008 14:06:06 +0000 |
| Subject: | note 56928 modified in features.commandline by joey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-136064@lists.php.net to get a copy of this message | ||
I needed this, you proly wont tho.
puts the exicution args into $_GET
<?php
if ($argv) {
foreach ($argv as $k=>$v)
{
if ($k==0) continue;
$it = explode("=",$argv[$i]);
if (isset($it[1])) $_GET[$it[0]] = $it[1];
}
}
?>
--was--
I needed this, you proly wont tho.
puts the exicution args into $_GET
<?php
if ($argv)
for ($i=1;$i<count($argv);$i++)
{
$it = split("=",$argv[$i]);
$_GET[$it[0]] = $it[1];
}
?>
http://php.net/manual/en/features.commandline.php