Getting Function create_function() is deprecated Error in laravel 5.4 and php 7.2. Not able to find solution.
please see below code
public static function delimiterToCamelCase($string, $delimiter = '[\-\_]')
{
// php doesn't garbage collect functions created by create_function()
// so use a static variable to avoid adding a new function to memory
// every time this function is called.
static $callback = null;
if ($callback === null) {
$callback = create_function('$matches', 'return strtoupper($matches[1]);');
}
return preg_replace_callback('/' . $delimiter . '(\w)/', $callback, $string);
}
please help.