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 "";
}