Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- address of functions
February 20, 2007, 9:53 pm
rate this thread
Is it possible to store the address or reference to a function in php? Maybe
using just a string and later dereferencing it?
e.g some ideas to illustrate what I mean
//how to get function from myarr and call it????
Re: address of functions
I'd just use call_user_func()/call_user_func_array(), and save the =
callback either as a string for normal functions, and as an array for =
$myarr['func1'] = 'myCompanyMotto';
$myarr['func2'] = array('foo','bar');