I had the same problem in a switch with string containing numbers ("15.2" is equal to "15.20" in a switch for php)
I solved the problem adding a letter before the text to compare
$var = '15.20';
switch ('#'.$var) {
case '#15.2' :
echo 'wrong';
break;
case '#15.20' :
echo 'right';
break;
}