PHP code example of pagon / argparser

1. Go to this page and download the library: Download pagon/argparser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pagon / argparser example snippets


$arg_parser = new \Pagon\ArgParser();

// Add a short arguments and support enum type
$arg_parser->add('a', array('help' => 'a long time with he happy', 'enum' => array(
    'go' => 'do some thing with go'
)));

// Add long and short arguments
$arg_parser->add('--long|-l', array('help' => 'long arguments', 'enum' => array('a', 'b')));

// Will get the arguments you want
$args = $arg_parser->parse();

// Print the help message
echo $arg_parser->help();