/** * 從一維,二維數組獲取多列的值 */ if(!function_exists('get_array_column')){ function get_array_column($input,$column=array()) { $data = array(); $columnKey = array_flip($column); $noArray = true; if(isset($input[0])&&is_array($input[0])) $noArray = false; foreach($columnKey as $key=>$v) { if($noArray) { $data[$key] = isset($input[$key])?$input[$key]:''; }else{ foreach($input as $k=>$value) { $data[$k][$key] = isset($value[$key])?$value[$key]:''; } } } return $data; } }