Home  >  Article  >  Backend Development  >  php cli参数可以兑现选择功能吗

php cli参数可以兑现选择功能吗

WBOY
WBOYOriginal
2016-06-13 12:45:46885browse

php cli参数可以实现选择功能吗?
php cli 可以实现参数传递,如下:
fwrite(STDOUT, "Enter your name: ");
$name = trim(fgets(STDIN));

现在我要他选择输入,可以这样实现
fwrite(STDOUT, "请选择程序运行模式:1为一键模式;2为自定义模式");

但有没有办法,直接输出两个选项:一键模式;为自定义模式
让用户用左右上下键就可以选择呢?谢谢

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn