create_function

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

Description

string create_function ( string args, string code)

דוגמה 1 .




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

דוגמה 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()

דוגמה 3 .