SimpleExcel\Parser\XMLParser::getColumn PHP Метод

getColumn() публичный Метод

Get data of the specified column as an array
public getColumn ( integer $col_num, boolean $val_only = TRUE ) : array
$col_num integer Column number
$val_only boolean Returns (value only | complete data) for every cell, default to TRUE
Результат array
    public function getColumn($col_num, $val_only = TRUE)
    {
        $col_arr = array();
        if (!$this->isColumnExists($col_num)) {
            throw new \Exception('Column ' . $col_num . ' doesn\'t exist', SimpleExcelException::COLUMN_NOT_FOUND);
        }
        // get the specified column within every row
        foreach ($this->table_arr['table_contents'] as $row) {
            if ($row['row_contents']) {
                if (!$val_only) {
                    array_push($col_arr, $row['row_contents'][$col_num - 1]);
                } else {
                    array_push($col_arr, $row['row_contents'][$col_num - 1]['value']);
                }
            } else {
                array_push($col_arr, "");
            }
        }
        // return the array
        return $col_arr;
    }