Command Line Password Prompt in PHP

后端 未结 10 1538
北海茫月
北海茫月 2020-11-30 21:48

I\'m writing a command line tool to help my web app. It needs a password to connect to the service. I\'d like the script to show a password prompt so I don\'t have to pass i

10条回答
  •  盖世英雄少女心
    2020-11-30 22:20

    Depending on your environment (i.e., not on Windows), you can use the ncurses library (specifically, the ncurses_noecho() function to stop keyboard echo and ncurses_getch() to read the input) to get the password without displaying it on screen.

提交回复
热议问题