# Skip leading rows

* Reading is available on Windows from extension `1.3.4.1` upwards;
* Extension version `>= 1.2.7`;
* When installing via PECL, answer `yes` when prompted to enable the reader.

## Function Prototype

```php
setSkipRows(int $skipRows): self
```

> Discards the first `$skipRows` rows of the active sheet from the iterator. Apply it after `openSheet()` and before `nextRow()` / `getSheetData()`.

## Test data preparation

```php
$config = ['path' => './tests'];
$excel  = new \Vtiful\Kernel\Excel($config);

$filePath = $excel->fileName('tutorial.xlsx')
    ->header(['', 'Cost'])
    ->data([
        [],
        ['viest', '']
    ])
    ->output();
```

## Example 1

```php
// read all data, skipping the first row
$data = $excel->openFile('tutorial.xlsx')
    ->openSheet('Sheet1')
    ->setSkipRows(1)
    ->getSheetData();
```

## Example 2

```php
// read all data, skipping the first two rows
$data = $excel->openFile('tutorial.xlsx')
    ->openSheet('Sheet1')
    ->setSkipRows(2)
    ->getSheetData();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xlswriter-docs.viest.me/english/reader/skip-rows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
