Command Line Password Prompt in PHP
问题 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 it as a command line argument. That's easy enough, but I'd like it to not echo the password to the screen as it's typed. How can I do this with PHP? Bonus points for doing it in pure PHP (no system('stty') ) and replacing the characters with * . EDIT: The script will run on a unix like system (linux or mac). The script is