PHP code example of rde / php-terminal

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

    

rde / php-terminal example snippets


use Rde\Flag;

$flag = new Flag;

// 取參照
$str = &$flag->string('str-name', 'default', 'describes...');

// 傳參照
$flag->intVar($int, 'int-name', 0, 'describes...');

// 解析
$args = $flag->parse($argv);

var_dump($args, $str, $int);