What is the issue with converting eregi to preg_match in PHP?

The issue with converting eregi to preg_match in PHP is that eregi is a case-insensitive version of preg_match, so simply replacing eregi with preg_match will make the comparison case-sensitive. To solve this issue, you can add the 'i' modifier to the regular expression pattern in preg_match to make it case-insensitive.

// Before
if (eregi('pattern', $string)) {
    // do something
}

// After
if (preg_match('/pattern/i', $string)) {
    // do something
}