Replace deprecated PHP function ereg_replace with supported function preg_replace.