PHP code example of oleics / ac-minimist

1. Go to this page and download the library: Download oleics/ac-minimist 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/ */

    

oleics / ac-minimist example snippets


use Ac\Minimist
$opts = Minimist::parse($argv);
var_dump($opts);

use Ac\Minimist
$opts = Minimist::parse($argv, [
  'string'    => ['foo', 'g'],
  'boolean'   => ['baz'],
  'alias'     => ['foo' => ['f', 'g']],
  'default'   => [ 'foo' => 'bar', 'baz' => function() { return false; } ],
  'stopEarly' => false,
  'unknown' => function($optname){return false;} // return TRUE for known options
]);
var_dump($opts);