Commonly used, and currently deprecated (as of PHP 5.3), ereg_replace() allowed developers to search for a regular expression within a string, and then replace the matched pattern with another string. This is probably one of the most painless deprecated functions to refactor. Simply search your code for ereg_replace and replace all instances with preg_replace.
Why is preg_replace superior?
One word: usefulness. preg_replace() accepts arrays or strings as parameters, and will perform the necessary operations “intelligently.” If you pass an array of patterns for the $pattern parameter, it will search for each of those expressions, and replace it with the string you provide as $replacement (or with its corresponding replacement if you pass an array). It will even search multiple subjects if you pass $subject as an array.
To summarize, preg_replace() was written to replace ereg_replace(). You can use it in exactly the same manner as ereg_replace() or you can make use of its more advanced functionality.
Yet another shining example of how PHP can work for you.