The function ereg_replace()
is deprecated, that means that it is no longer supported by PHP by a particular reason (can be security or performance reasons, for example).
Instead, use preg_replace()
. You also need to replace the regular expression string
[ ]{2,}
to
/[ ]{2,}/
2
solved Deprecated: Function ereg_replace() is deprecated [closed]