php anonymous function parameters -


i'm trying understand anonymous functions in php (laravel framework) , searched basic question here didn't find answer.

echo preg_replace_callback('~-([a-z])~', function ($match) {     return strtoupper($match[1]); }, 'hello-world'); // outputs helloworld 

what parameters gone inside anonymous function ??

route::match(['get', 'post'], '/', function () {     return 'hello world'; }); 

http://php.net/preg_replace_callback

a callback called , passed array of matched elements in subject string. callback should return replacement string. callback signature:

so sends in array of matches.


Comments

Popular posts from this blog

apache - setting document root in antoher partition on ubuntu -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -

Process 'command 'F:\android-sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1 -