I’m need to send params to the function
array_intersect_key()
but sometimes i’m need to send 2 arrays, sometimes – 3 or more:
array_intersect_key($arr_1, $arr_2);
OR
array_intersect_key($arr_1, $arr_2, $arr_3, $arr_4);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming you want to create your own function like this, the key is to use
func_get_args():If you just want to call it with multiple args, either “just do it”, or use
call_user_func_array():