How can you modify a regular expression pattern to allow for case-insensitive matching in PHP?

To allow for case-insensitive matching in PHP regular expressions, you can add the 'i' modifier at the end of the pattern. This modifier tells PHP to perform a case-insensitive match when applying the regular expression pattern.

$pattern = '/hello/i';
$string = 'Hello, World!';
if (preg_match($pattern, $string)) {
    echo 'Match found!';
} else {
    echo 'No match found.';
}