passing a function as a parameter

From: Date: Fri, 11 Jun 2004 14:25:54 +0000
Subject: passing a function as a parameter
Groups: php.general 
Request: Send a blank email to php-general+get-188102@lists.php.net to get a copy of this message
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".

« previous php.general (#188102) next »