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://pwwzsj.com/article/gjsegg.html