create_function
Creates a function dynamically from the parameters passed, and returns a unique name for it.
Caution:
This function internally performs an eval and as such has the same security issues as eval. It also has bad performance and memory usage characteristics, because the created functions are global and can not be freed.
A native anonymous function should be used instead.
Parameters
It is normally advisable to pass these parameters as single quoted strings. If using double quoted strings, variable names in the code need to be escaped carefully, e.g. \$somevar.
- args
-
The function arguments, as a single comma-separated string.
- code
-
The function code.
Return Values
Returns a unique function name as a string, or false on failure. Note that the name contains a non-printable character ("\0"), so care should be taken when printing the name or incorporating it in any other string.