PHPackages                             samejack/php-argv - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. samejack/php-argv

ActiveLibrary[CLI &amp; Console](/categories/cli)

samejack/php-argv
=================

PHP CLI arguments parse.

1.0.3(5y ago)2692.1k↓22.2%64Apache-2.0PHPPHP &gt;=5.3.0CI failing

Since Apr 13Pushed 5y ago1 watchersCompare

[ Source](https://github.com/samejack/php-argv)[ Packagist](https://packagist.org/packages/samejack/php-argv)[ Docs](https://github.com/samejack/php-argv)[ RSS](/packages/samejack-php-argv/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (5)Used By (4)

php-argv
========

[](#php-argv)

[![Latest Stable Version](https://camo.githubusercontent.com/59dbf319b55300b04f51c3cd5423d7f53775b42eea034af3f7ed9304628e4234/68747470733a2f2f706f7365722e707567782e6f72672f73616d656a61636b2f7068702d617267762f762f737461626c65)](https://packagist.org/packages/samejack/php-argv)[![Build Status](https://camo.githubusercontent.com/69873c8e2980e32866656a10299fb53a7370147fec1fdf4176e646f54cda4901/68747470733a2f2f7472617669732d63692e6f72672f73616d656a61636b2f7068702d617267762e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/samejack/php-argv) [![Coverage Status](https://camo.githubusercontent.com/c6b9f5134ec58795c31a336eab04b30f20b357105fa9bebaafe8998ac97e98ca/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f73616d656a61636b2f7068702d617267762f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/samejack/php-argv?branch=master)[![License](https://camo.githubusercontent.com/80648ed2cb08113a09b96a895fa3ad25f64c561ccf33bdc46ee2f83f7c201ebc/68747470733a2f2f706f7365722e707567782e6f72672f73616d656a61636b2f7068702d617267762f6c6963656e7365)](https://packagist.org/packages/samejack/php-argv)

PHP CLI (command-line interface) argurments parser. PHP-Argv can parse rich pattern, such as the follows

Install by composer
-------------------

[](#install-by-composer)

```
composer require samejack/php-argv
```

CLI Example
-----------

[](#cli-example)

```
$ ./example/bin-cli -h 127.0.0.1 -u=user -p passwd --debug --max-size=3 test
Array
(
    [h] => 127.0.0.1
    [u] => user
    [p] => passwd
    [debug] => 1
    [max-size] => 3
    [test] => 1
)

```

PHP Example
-----------

[](#php-example)

```
