What are the best practices for case-insensitive searching in PHP using regular expressions?

When performing case-insensitive searching in PHP using regular expressions, the `i` modifier should be added to the regex pattern. This modifier tells PHP to perform a case-insensitive search. By including the `i` modifier, the regex pattern will match regardless of the case of the letters in the input string.

$pattern = "/search term/i";
$input = "This is a Search Term example";
if (preg_match($pattern, $input)) {
    echo "Match found!";
} else {
    echo "No match found.";
}