i have the following function for replace variables in a string
function replace_variables($string,$variables)
{
        return preg_replace_callback('/{\$([A-Za-z_]+)\}/', 
           create_function ('$matches', 'return $$variables[1];'), $string);
}
In php 7.2 create_function is deprecated and i dont know how to rewrite the function to work with php 5.2
Thanks
 
     
    