I\'m maintaining a PHP library that is responsible for fetching and storing incoming data (POST, GET, command line arguments, etc). I\'ve just fixed a bug that would not all
So if a CLI is as such
php path\to\script.php param1=no+array param2[]=is+array param2[]=of+two
Then the function thats reads this can be
function getArguments($args){
unset($args[0]); //remove the path to script variable
$string = implode('&',$args);
parse_str($string, $params);
return $params;
}
This would give you
Array
(
[param1] => no array
[param2] => Array
(
[0] => is array
[1] => of two
)
)