use Phalcon\Cop\Parser;
$parser = new Parser();
// Parse params from the $argv
$params = $parser->parse($argv);
// Parse params from the $_SERVER['argv']
$params = $parser->parse();
// After parsing input, Parser provides a way to gets booleans:
$parser->getBoolean('foo');
// Get param `foo` or return TRUE as a default value
$parser->getBoolean('foo', true);Methods
get($key, $default = null)(1.2 and later): the value of$keyin the result of the lastparse(), or$defaultwhen the result has no$key.getBoolean(string $key, bool $default = false): bool: the value of$keyas a boolean. An option with no value givestrue;y,yes,true,1andongivetrue;n,no,false,0andoffgivefalse. A missing key or another value gives$default.getParsedCommands(): array(1.2 and later): the result of the lastparse().has($key): bool(1.2 and later):truewhen the result of the lastparse()has$key.parse(array $argv = []): array: parses$argv($_SERVER['argv']when$argvis empty) without its first item, the script name, and returns the options and the arguments.