SimpleExcel\Parser\XMLParser::getCell PHP Method

getCell() public method

Get value of the specified cell
public getCell ( integer $row_num, integer $col_num, integer $val_only = true ) : array
$row_num integer Row number
$col_num integer Column number
$val_only integer Whether returns only it's value or complete data
return array
    public function getCell($row_num, $col_num, $val_only = true)
    {
        // check whether the cell exists
        if (!$this->isCellExists($row_num, $col_num)) {
            throw new \Exception('Cell ' . $row_num . ',' . $col_num . ' doesn\'t exist', SimpleExcelException::CELL_NOT_FOUND);
        }
        if (is_array($this->table_arr['table_contents'][$row_num - 1]['row_contents'])) {
            if (array_key_exists($col_num - 1, $this->table_arr['table_contents'][$row_num - 1]['row_contents'])) {
                $cell = $this->table_arr['table_contents'][$row_num - 1]['row_contents'][$col_num - 1];
                if (!$val_only) {
                    return $cell;
                } else {
                    return $cell['value'];
                }
            }
        }
        return "";
    }