PHP code example of mortenscheel / php-inquirer

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

    

mortenscheel / php-inquirer example snippets


$name = Text::make()->prompt('Name')->placeholder('John Doe')->run();
$password = Password::make()->prompt('Password')->confirm()->run();
$birthday = Date::make()->prompt('Birthday')->maxDate(date('Y-m-d'))->run();
$whitespace = Select::make()->prompt('Indentation')->options(['Tabs', 'Spaces'])->run();
$hobbies = MultiSelect::make()->options(['Programming', 'Music', 'Cooking'])->initial(['Programming'])->run();
$bio = Editor::make()->prompt('Your Bio')->hint('Close editor when finished')->run();
$confirm = Confirm::make()->prompt('Proceed')->default(true)->run();

echo json_encode(compact('name', 'password', 'birthday', 'whitespace', 'hobbies', 'bio', 'confirm'), JSON_PRETTY_PRINT);