note 11565 modified in functions.arguments by felipe

From: Date: Tue, 22 Jul 2008 18:59:23 +0000
Subject: note 11565 modified in functions.arguments by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142536@lists.php.net to get a copy of this message
here is the code to pass a user defined function as an argument. Just like in the usort method. <?php func2("func1"); function func1 ($arg){ print ("Hello $arg"); } function func2 ($arg1){ $arg1("World"); //Does the same thing as the next line call_user_func ($arg1, "World"); } ?> --was-- here is the code to pass a user defined function as an argument. Just like in the usort method. <?php func2("func1"); function func1 ($arg){ print ("Hello $arg"); } function func2 ($arg1){ $arg1("World"); //Does the same thing as the next line call_user_func ($arg1, "World"); } ?> http://php.net/manual/en/functions.arguments.php

« previous php.notes (#142536) next »