一、NODE JS:
- 代码:
test.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:
- 代码:
test.php
<?php
<?php
while ($result = trim(fgets(STDIN))){
echo "hello:".$result.PHP_EOL;
}
- 测试:
|