My code looks like this :
switch ($input)
{
case "hello":
.......code1..... ;
break;
case "bye" :
......code2 .....;
break;
case "xoxo":
.......code3.....;
break;
default:
.......code4.....;
}
And I am using $input=fgets(STDIN)
to take the input but it doesn't execute the respective codes even if the case is matched.
A var_dump($input);
or an echo $input;
shows the value is assigned correctly (at least it looks to me).
What do i need to add (or modify) in the codes ?