标签:PHP命令行交互模式
一、NODE JS:var readline = require(‘readline‘);
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question("what is your name?", function(result) {
console.log(result)
rl.close();
});
<?php
fwrite(STDOUT, "what is your name?");
$result = trim(fgets(STDIN));
echo trim($result);
标签:PHP命令行交互模式
原文地址:http://blog.51cto.com/12173069/2090804