PHP code example of stk2k / argparser
1. Go to this page and download the library: Download stk2k/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/ */
stk2k / argparser example snippets
ArgParser::parse(array $args = null, array $
use stk2k\argparser\ArgParser;
$args = ArgParser::parse(); // script.php a b -c --favorite-food="Fried potato"
print_r($args);
//Array
//(
// [0] => /path/to/script.php
// [1] => a
// [2] => b
// [-c] => 1
// [--favorite-food] => Fried potato
//)