PHP CLI Arguments Parser (Miscellaneous)

A simple, battle tested and lightweight script to help you to parse command line arguments in php cli scripts.
It behave like many command line parsers in *nix cli softwares.

For example in

php script.php -asd --foo=bar --qwe

you’ll get

array(5) {
  ["a"]=>
  bool(true)
  ["s"]=>
  bool(true)
  ["d"]=>
  bool(true)
  ["foo"]=>
  string(3) "bar" 
  ["qwe"]=>
  bool(true)
}

Download PHP CLI Arguments Parser (Miscellaneous)

Leave a Reply

Your email address will not be published. Required fields are marked *