I'm trying to understand Anonymous Functions in php (laravel framework) , I searched about my basic question here but I didn't find the answer.
echo preg_replace_callback('~-([a-z])~', function ($match) {
return strtoupper($match[1]);
}, 'hello-world');
// outputs helloWorld
What parameters gone inside the anonymous function ??
Route::match(['get', 'post'], '/', function () {
return 'Hello World';
});
preg_replace_callbackto see what arguments it sends.