What is the purpose of the i-modifier in regular expressions, and how does it affect the matching behavior in PHP?

The i-modifier in regular expressions in PHP is used to perform case-insensitive matching. This means that when the i-modifier is used, the regular expression will match regardless of the case of the characters in the input string. To use the i-modifier in PHP, simply append 'i' after the closing delimiter of the regular expression. Example:

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