SimpleExcel\Parser\XMLParser::getRow PHP Method

getRow() public method

Get data of the specified row as an array
public getRow ( integer $row_num, boolean $val_only = TRUE ) : array
$row_num integer Row number
$val_only boolean Returns (value only | complete data) for every cell, default to TRUE
return array
    public function getRow($row_num, $val_only = TRUE)
    {
        if (!$this->isRowExists($row_num)) {
            throw new \Exception('Row ' . $row_num . ' doesn\'t exist', SimpleExcelException::ROW_NOT_FOUND);
        }
        $row = $this->table_arr['table_contents'][$row_num - 1]['row_contents'];
        $row_arr = array();
        // get the specified column within every row
        foreach ($row as $cell) {
            if (!$val_only) {
                array_push($row_arr, $cell);
            } else {
                array_push($row_arr, $cell['value']);
            }
        }
        // return the array, if empty then return FALSE
        return $row_arr;
    }