Moving from preg_replace to preg_replace_callback [duplicate]


This question already has an answer here:


I've had a good look through all the previous topics and I don't understand enough PHP to use them to answer my questions so sorry in advance if this is really simple!

{   $content = preg_replace('/$([w]+)/e' '$0' $this->getTemplateStyle());   $custom_css = $this->getCustomCSS();   return $content.$custom_css;  }  

And I need to replace preg_replace with preg_replace_callback. I know it's not a simple switch and that I need to add more to the code