call_user_func($func) and $func() are much better alternatives.
Daniel Clark wrote:
Can you use eval() ?
I want to pass a function as a parameter and execute it in another
function.
A callback. :-)
For example:
function a() {
echo "a";
}
function b( $func ) {
func();
echo "b";
}
The ou
Can you use eval() ?
> I want to pass a function as a parameter and execute it in another
> function.
> A callback. :-)
>
> For example:
>
> function a() {
> echo "a";
> }
>
>
> function b( $func ) {
> func();
> echo "b";
> }
>
>
> The output of "b( a )" will be "ab".
--
PHP Gener
I want to pass a function as a parameter and execute it in another function.
A callback. :-)
For example:
function a() {
echo "a";
}
function b( $func ) {
func();
echo "b";
}
The output of "b( a )" will be "ab".
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: ht
3 matches
Mail list logo