What is the potential issue with using eregi_replace in PHP and what alternative function can be used?

The potential issue with using eregi_replace in PHP is that it is deprecated as of PHP 5.3.0 and removed in PHP 7.0.0 due to its use of a deprecated regular expression modifier. An alternative function that can be used is preg_replace with the 'i' modifier to perform a case-insensitive search and replace.

// Using preg_replace as an alternative to eregi_replace
$new_string = preg_replace('/pattern/i', 'replacement', $old_string);