189 8069 5689

nodejs、php命令行交互模式

一、NODE JS:

  1. 代码:
    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();
    });
  2. 测试:
    nodejs、php命令行交互模式

    二、PHP:

  3. 代码:
    test.php
  4. 测试:
    nodejs、php命令行交互模式

分享标题:nodejs、php命令行交互模式
网站路径:http://cdxtjz.cn/article/gjsegg.html