Posts: 1,832
Location: Somewhere else entirely
|
Say you want a function that returns another function, but what this new function does depends on results from some other part of your code. You can't know what these results will be before you start, so create_function allows you to create new bits of PHP using PHP itself.
Anonymous functions are useful when you need to pass a function as an argument, but only want to use it once. This way you don't have to store them or come up with new names for them all. Of course if you want to refer tothem again you have to assign them to a variable.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';
Please login or register to view this content. Registration is FREE (aka MSN handwriting for forums)
|