Defining Anonymous Functions in PHP


Create anonymous functions for temporary use or as callback functions.

Source Code

$greet = function($name) {
    return "Hello, $name!";
};
echo $greet("John");
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments