I want to pass functon as an argument using PHP in an equivalent way that jQuery allows you to pass functions.
JQuery
$("#foo").bind("click", function(){ alert("Hello world!"); });
So, I tried this with 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 return "peace! Hello" .... why does it return the result back?
user2637824
source share