replaced preg_replace e modifier with preg_replace_callback

replaced preg_replace with e modifier to omit warnings