PHP code example of netfocusinc / argh

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

    

netfocusinc / argh example snippets




etfocusinc\argh\Argh;
use netfocusinc\argh\StringParameter;

// Create a new Argh instance
$argh = new Argh(
  [
    StringParameter::createWithAttributes( [ 'name' => 'message' ] )		
  ]
);

// Let Argh parse PHP's $argv array
$argh->parse($argv);

// Access run-time values of the arguments that were supplied to your CLI script
echo $argh->message; // Hello World!