PHP code example of climphp / clim
1. Go to this page and download the library: Download climphp/clim 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/ */
climphp / clim example snippets
= new Clim\App();
$app->opt('-u|--upper');
$app->arg('name')->default('unknown');
$app->task(function ($opts, $args) {
$name = $args['name'];
if ($opts['u']) $name = strtoupper($name);
echo "Welcome, {$name}\n";
});
$app->run();
bash
$ php hello.php Nocchi
Welcome, Nocchi
$ php hello.php -u Kashiyuka
Welcome, KASHIYUKA