create_function

create_function -- Create an anonymous (lambda-style) function

Description

string create_function ( string args, string code)

Voorbeeld 1 .




Or, perhaps to have general handler function that can apply a set of operations to a list of parameters:

Voorbeeld 2 .








and when you run the code above, the output will be:











But perhaps the most common use for of lambda-style (anonymous) functions is to create callback functions, for example when using array_walk() or usort()

Voorbeeld 3 .