roundcubemail/program/lib/Roundcube/rcube_addressbook.php
public static function get_col_values($col, $data, $flat = false)
    {
        $out = array();
        foreach ((array)$data as $c => $values) {
            if ($c === $col || strpos($c, $col.':') === 0) {
                if ($flat) {
                    $out = array_merge($out, (array)$values);
                }
                else {
                    list(, $type) = explode(':', $c);
                    $out[$type] = array_merge((array)$out[$type], (array)$values);
                }
            }
        }

        // remove duplicates
        if ($flat && !empty($out)) {
            $out = array_unique($out);
        }

        return $out;
    }
public static function get_col_values($col, $data, $flat = false)
    {
        $out = array();
        foreach ((array)$data as $c => $values) {
            if ($c === $col || strpos($c, $col.':') === 0) {
                if ($flat) {
                    $out = array_merge($out, (array)$values);
                }
                else {
                    list(, $type) = explode(':', $c);
                    $out[$type] = array_merge((array)$out[$type], (array)$values);
                }
            }
        }

        // remove duplicates
        if ($flat && !empty($out)) {
            $out = array_unique($out);
        }

        return $out;
    }
public static function get_col_values ( $ col , $ data , $ flat = false ) { $ out = array ( ) ; foreach ( ( array ) $ data as $ c => $ values ) { if ( $ c === $ col || strpos ( $ c , $ col . ':' ) === 0 ) { if ( $ flat ) { $ out = array_merge ( $ out , ( array ) $ values ) ; } else { list ( , $ type ) = explode ( ':' , $ c ) ; $ out [ $ type ] = array_merge ( ( array ) $ out [ $ type ] , ( array ) $ values ) ; } } } // remove duplicates if ( $ flat && ! empty ( $ out ) ) { $ out = array_unique ( $ out ) ; } return $ out ; }
Utility function to return all values of a certain data column
either as flat list or grouped by subtype

@param string $col  Col name
@param array  $data Record data array as used for saving
@param bool   $flat True to return one array with all values,
False for hash array with values grouped by type

@return array List of column values
Utility function to return all values of a certain data column either as flat list or grouped by subtype