how to work with multiple array in php code example
Example 1: in array php multiple values
$haystack = array(...);
$target = array('foo', 'bar');
if(count(array_intersect($haystack, $target)) == count($target)){
}
if(count(array_intersect($haystack, $target)) > 0){
}
Example 2: php multiple array to single array
$array = array_column($array, 'plan');
$CI = get_instance();
$DB1 = $CI->load->database('nama_db', TRUE);
$sql = "select dept from v_dept_distinct order by dept asc ";
$query=$DB1->query($sql);
return array_column($query->result_array() , 'dept');