php 运行时读取命令行输入命令 方式一: $stdin = fopen('php://stdin', 'r'); $line = trim(fgets($stdin)); 网上查的,这个可以,可能还有其它方式或写法