I am wanting to pass a functon as an argument using PHP, in the equivalent way that jQuery allows passing of functions.
jQuery:
$("#foo").bind("click", function(){
alert("Hello world!");
});
So, I tried this using PHP:
$arg1 = "Hello";
$arg2 = function($name){echo $name;};
function call_me($func_arg1="", $func_arg2=""){
echo $func_arg1." ".$func_arg2("world!");
}
call_me($arg1, $arg2);
... but I get "world!Hello" returned .... why does it return the outcome backwards ?