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

WBOY
Release: 2016-06-13 12:45:46
Original
919 people have browsed it

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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!