nodejs、php命令行交互模式
一、NODE JS:
- 代码:
test.jsvar 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 - 测试:
网站名称:nodejs、php命令行交互模式
链接地址:http://ybzwz.com/article/gjsegg.html