SimpleExcel\Parser\BaseParser::getColumn PHP Method

getColumn() public method

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
return 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 as $row) {
            array_push($col_arr, $row[$col_num - 1]);
        }
        // return the array
        return $col_arr;
    }