I have the following line of code in my program
$html = preg_replace_callback(‘/\{DATE\s+(.*?)\}/’,create_function(‘$matches’, ‘return date($matches[1]);’),$html );
I am getting a warning about it being deprecated. I have tried the following two lines separately and get an error with both.
$html = preg_replace_callback(‘/\{DATE\s+(.*?)\}/’, function($matches) { return date($matches[1]); },$html );
$html = preg_replace_callback(‘/\{DATE\s+(.*?)\}/’, function($matches) { return date($matches[1]); },$html );
Can anyone help me convert from preg_replace to preg_replace_callback.