What is the recommended alternative to eregi() in PHP 5.3.0 and later versions?

The recommended alternative to eregi() in PHP 5.3.0 and later versions is to use the preg_match() function with the 'i' modifier to perform a case-insensitive match. This function allows you to specify regular expressions for pattern matching while also providing the flexibility to ignore case sensitivity.

// Using preg_match() with the 'i' modifier as an alternative to eregi()
if (preg_match("/pattern/i", $string)) {
    // Match found
} else {
    // No match found
}