PHP code example of zzengineer / getoptc
1. Go to this page and download the library: Download zzengineer/getoptc 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/ */
zzengineer / getoptc example snippets
while (($c = getoptc($argv,'ab:c::', $optind, $optarg)) !== false)
switch ($c) {
case 'a': $flag_a=true; break;
case 'b': $arg_b=$optarg; break;
case 'c': $flag_c=true; $arg_c=$optarg; break;
case '?':
case ':':
default : usage(); exit(1);
}
for ($i = $optind; $i < count($argv); $i++)
print "programm argument ". $argv[$i]. PHP_EOL;