PHP code example of iphper / stdin
1. Go to this page and download the library: Download iphper/stdin 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/ */
iphper / stdin example snippets
use Stdin\Stdin;
$stdin = new Stdin();
// 获取一行数据
$line = $stdin->line('line:');
var_dump($line);
// 获取一个字符
$char = $stdin->char('char:');
var_dump($char);
// 获取多行数据【输入空行确认】
$arrr = $stdin->array('array:');
var_dump($arrr);
// 获取int类型数据
$int = $stdin->int('int:');
var_dump($int);
// 获取float类型数据
$float = $stdin->float('float:');
var_dump($float);
// 获取bool类型数据
$bool = $stdin->bool('bool:');
var_dump($bool);