when I get input from cli, I var_dump it and this showed for me:
string(2) "Y
"
So how I understand I receive the single char and the bag of blank spaces, so this code will return false ($input == "Y")
. How I can solve this issue?
You can easily remove all this whitespace using trim()
(trim($input) == 'Y')