I have two functions and want to when $test=one
, function1()
runs and when $test=two
, function2()
runs. Like this:
switch ($test)
{
case "one":
function1();
break;
case "two":
function2();
break;
}
Now how do it (selecting) via array? any body know?
how set key of array on function ? something like this:
array("one"=>function1(),"two"=>function2());