I have five arrays and a search for which user can do search randomly. So for among those five sometimes there may be value for two arrays, three arrays or five arrays and whatever.
So When I intersect I am not be able to check which are empty so that it always returns an empty array.
$full_ids = array_intersect($g_arr, $c_arr, $k_arr, $m_arr, $p_arr);
Actually I need to check and make this dynamic like if there are values for $g_arr, $c_arr
then the above operation will be applied with these two.. like
$full_ids = array_intersect($g_arr, $c_arr);
I don't understand how to check that? Any help w'd be appreciated..thanks