replace deprecated method ereg_replace with preg_replace