What are the best practices for handling string comparisons in PHP switch case statements?

When using string comparisons in PHP switch case statements, it is important to handle case sensitivity properly. To ensure consistent behavior, it is recommended to use strtolower() or strtoupper() functions to normalize the strings before comparing them in the switch case statement.

$myString = "example";

switch(strtolower($myString)) {
    case "example":
        echo "String is 'example'";
        break;
    case "another example":
        echo "String is 'another example'";
        break;
    default:
        echo "String does not match any cases";
}