Im trying to call a function dynamically, using call_user_func_array, but the issue I'm facing is that if the function returns boolean,Parameter variables are stored in an array, but if the function returns a string it will work fine
call_user_func_array() expects parameter 1 to be a valid callback, function 'equal' not found or invalid function name not included in ...
$param = array (
0 => Jill
1 => Jack
);
echo call_user_func_array("equal", $param);
function equal($str, $str_2) {
if ($str==$str_2) {
return true;
} else {
return false;
}
}
equalis included?equal()before you callcall_user_func_array()?NULL, and demonstrate withecho, which would be an odd choice for a boolean or an array. Does the code as you've posted it actually reproduce the error for you?array()syntax is wrong, but that shouldn't cause this error. Jack and Jill need to be in quotes, and you need a comma between them.