### Set Starting Column Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/94-api-class-csv-reader.md Configures the reader to start processing from a specific column number. Returns the CsvReader instance for method chaining. ```php public function fromCol(int $colNum): CsvReader ``` -------------------------------- ### fromCol() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/94-api-class-csv-reader.md Sets the starting column for reading. ```APIDOC ## fromCol() ### Description Sets the starting column for reading. ### Parameters * `int $colNum` ``` -------------------------------- ### Set Starting Row Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/94-api-class-csv-reader.md Configures the reader to start processing from a specific row number. Returns the CsvReader instance for method chaining. ```php public function fromRow(int $rowNum): CsvReader ``` -------------------------------- ### fromRow() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/94-api-class-csv-reader.md Sets the starting row for reading. ```APIDOC ## fromRow() ### Description Sets the starting row for reading. ### Parameters * `int $rowNum` ``` -------------------------------- ### getFreezePaneInfo Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get freeze pane info. ```APIDOC ## getFreezePaneInfo() ### Description Get freeze pane info. ### Parameters None ``` -------------------------------- ### getConditionalFormatting Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get conditional formatting rules. ```APIDOC ## getConditionalFormatting() ### Description Get conditional formatting rules. ### Parameters None ``` -------------------------------- ### Install FastExcelReader using Composer Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Use Composer to add FastExcelReader to your PHP project. This is the standard method for managing dependencies. ```bash composer require avadim/fast-excel-reader ``` -------------------------------- ### Read Cells with Formatted Dates Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Reads all cells from an Excel file after setting a specific date format. This example demonstrates how to get dates as formatted strings instead of timestamps. ```php $excel = Excel::open($file); $excel->setDateFormat('Y-m-d'); $result = $excel->readCells(); print_r($result); ``` -------------------------------- ### getImageList Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get image list. ```APIDOC ## getImageList() ### Description Get image list. ### Parameters None ``` -------------------------------- ### getColumnStyle Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get column style. ```APIDOC ## getColumnStyle() ### Description Get column style. ### Parameters * `int|string $col` * `bool|null $flat` ``` -------------------------------- ### Get Media Image Files Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Fetches a list of all image files located in the workbook's media directory. Returns an array of file names. ```php public function mediaImageFiles(): array ``` -------------------------------- ### name Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get the name of the sheet. ```APIDOC ## name() ### Description Get sheet name. ### Method GET ### Endpoint /sheet/name ### Parameters _None_ ### Response #### Success Response (200) - **name** (string) - The name of the sheet. ### Response Example ```json { "name": "Sheet1" } ``` ``` -------------------------------- ### sheet() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Gets the current default sheet or a specified sheet by name. ```APIDOC ## sheet() ### Description Get current or specified sheet. ### Method ```php public function sheet(?string $name = null): ?Sheet ``` ### Parameters #### Query Parameters - **name** (string|null) - Optional - The name of the sheet to retrieve. If null, returns the current default sheet. ``` -------------------------------- ### getAllColAttributes Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get all column attributes. ```APIDOC ## getAllColAttributes() ### Description Get all column attributes. ### Parameters None ``` -------------------------------- ### getColumnWidth Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get width of the column. ```APIDOC ## getColumnWidth() ### Description Get width of the column. ### Parameters * `int|string $colNumber` ``` -------------------------------- ### getImageName Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get image name. ```APIDOC ## getImageName() ### Description Get image name. ### Parameters * `string $cell` ``` -------------------------------- ### Get Sheet Name Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves the name of the sheet. ```php public function name(): string ``` -------------------------------- ### Get Image List Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves a list of all images present in the workbook. Returns an array of image information. ```php public function getImageList(): array ``` -------------------------------- ### getImageBlob Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get image content as binary string. ```APIDOC ## getImageBlob() ### Description Get image content as binary string. ### Parameters * `string $cell` ``` -------------------------------- ### Get First Sheet Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Returns the first sheet in the workbook. Optionally allows specifying a read area range and if the first row contains keys. ```php public function getFirstSheet(?string $areaRange = null, ?bool $firstRowKeys = false): Sheet ``` -------------------------------- ### Get Sheet Name Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Returns the name of the current sheet. ```php name() ``` -------------------------------- ### Set Comment Prefix Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/95-api-class-csv-options.md Configures the character that signifies the start of a comment line in the CSV file. ```APIDOC ## setCommentPrefix() ### Description Set comment prefix. ### Parameters * `string|null $value` - The comment prefix character. Use null to disable. ``` -------------------------------- ### path Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get the path to the sheet's XML file within the ZIP archive. ```APIDOC ## path() ### Description Get path to the sheet XML file in ZIP archive. ### Method GET ### Endpoint /sheet/path ### Parameters _None_ ### Response #### Success Response (200) - **path** (string) - The path to the sheet's XML file within the ZIP archive. ### Response Example ```json { "path": "xl/worksheets/sheet1.xml" } ``` ``` -------------------------------- ### state() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Gets the current sheet state (visible, hidden, veryHidden). ```APIDOC ## state() ### Description Gets the current sheet state (visible, hidden, veryHidden). ### Method (Not specified, likely a method call) ### Endpoint (Not applicable, SDK method) ### Parameters #### Path Parameters (None specified) #### Query Parameters (None specified) #### Request Body (None specified) ### Request Example (Not specified) ### Response #### Success Response - **string** - The current state of the sheet (e.g., 'visible', 'hidden', 'veryHidden'). #### Response Example (Not specified) ``` -------------------------------- ### Get Complete Style by Index Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves the full style definition for a given style index. Can return a flat array representation. ```php public function getCompleteStyleByIdx(int $styleIdx, ?bool $flat = false): array ``` -------------------------------- ### Use zero-based indexing for rows and columns Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Reads rows with zero-based indexing for both rows and columns, resulting in numerical keys starting from 0 for both dimensions. ```php // Rows and cols start from zero $result = $excel->readRows(false, Excel::KEYS_ZERO_BASED); ``` -------------------------------- ### Get CSV Options Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/94-api-class-csv-reader.md Retrieves the current CSV parsing options configured for the reader. ```php public function getOptions(): CsvOptions ``` -------------------------------- ### Get Freeze Pane Information Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Retrieves the freeze pane configuration for a sheet, which defines how the sheet is split and frozen. ```php $excel = Excel::open($file); $sheet = $excel->selectSheet('SheetName'); // Get the freeze pane configuration $freezePaneConfig = $sheet->getFreezePaneInfo(); print_r($freezePaneConfig); ``` -------------------------------- ### Get Tab Color Information Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Retrieves the tab color configuration for a sheet, including theme and tint values. ```php $excel = Excel::open($file); $sheet = $excel->selectSheet('SheetName'); // Get the tab color configuration $tabColorConfig = $sheet->getTabColorInfo(); print_r($tabColorConfig); ``` -------------------------------- ### Get Sheet XML Path Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves the path to the sheet's XML file within the ZIP archive. ```php public function path(): string ``` -------------------------------- ### getTabColorConfiguration Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get the tab color configuration for the sheet. This is an alias for getTabColorConfig(). ```APIDOC ## getTabColorConfiguration() ### Description Get tab color configuration. Alias of getTabColorConfig(). ### Method GET ### Endpoint /sheet/tabColorConfiguration ### Parameters _None_ ### Response #### Success Response (200) - **tabColorConfiguration** (array|null) - An array containing the tab color configuration, or null if not set. ### Response Example ```json { "tabColorConfiguration": { "rgb": "FF0000", "theme": 1, "tint": 0.5 } } ``` ``` -------------------------------- ### Get Format Pattern by Style Index Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Fetches the format pattern string associated with a specific style index. Returns the pattern or mixed type. ```php public function getFormatPattern(int $styleIdx): mixed|string ``` -------------------------------- ### Get All Sheets Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Returns an array containing all sheets present in the workbook. No parameters are required. ```php public function sheets(): array ``` -------------------------------- ### __construct() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/94-api-class-csv-reader.md Initializes a new instance of the CsvReader class. ```APIDOC ## __construct() ### Description CsvReader constructor. ### Parameters * `string $file` * `CsvOptions|array|null $options` ``` -------------------------------- ### Get Sheet Names Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Returns an array containing the names of all sheets in the workbook. ```php public function getSheetNames(): array ``` -------------------------------- ### Get Sheet State Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves the current state of the sheet (visible, hidden, or very hidden). ```php public function state(): string ``` -------------------------------- ### Get Freeze Pane Configuration Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Retrieves an array containing the freeze pane configuration for the sheet. This indicates which rows or columns are frozen. ```php getFreezePaneConfig() ``` -------------------------------- ### __construct() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Initializes the Excel class, optionally opening a specified file and setting a temporary directory. ```APIDOC ## __construct() ### Description Initializes the Excel class, optionally opening a specified file and setting a temporary directory. ### Method __construct ### Parameters - **file** (string|null) - The path to the Excel file to open. - **tempDir** (string|null) - The directory to use for temporary files. ``` -------------------------------- ### Skip Comment Lines Source: https://github.com/avadim483/fast-excel-reader/blob/main/README-CSV.md Ignore lines that start with a specific prefix, such as '#', by setting the 'comment_prefix' option. ```php $csv = Excel::openCsv('config.csv', ['comment_prefix' => '#']); foreach ($csv->nextRow() as $row) { // Rows starting with # will be ignored } ``` -------------------------------- ### Combine result modes and options Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Demonstrates combining result modes with additional options like using a custom array for keys and zero-based row indexing. This allows for flexible data structuring. ```php $result = $excel->readRows(['A' => 'bee', 'B' => 'honey'], Excel::KEYS_FIRST_ROW | Excel::KEYS_ROW_ZERO_BASED); ``` -------------------------------- ### Get Dimension Range Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Returns the dimension range of the default work area from the sheet properties. This is a fast way to get the data area but may be inaccurate. ```php dimension() ``` -------------------------------- ### Excel Constructor Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Initializes the Excel class. Optionally accepts a file path and a temporary directory path. ```php public function __construct(?string $file = null, ?string $tempDir = '') ``` -------------------------------- ### Get Date Format Pattern by Style Index Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Fetches the PHP date format pattern associated with a specific style index. Returns null if not found. ```php public function getDateFormatPattern(int $styleIdx): ?string ``` -------------------------------- ### actualDimension Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get the actual dimension range (e.g. "A1:C10"). ```APIDOC ## actualDimension() ### Description Get the actual dimension range (e.g. "A1:C10"). ### Parameters None ``` -------------------------------- ### Get Tab Color Info Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves detailed tab color information, which may include RGB, theme, tint, or indexed color values. ```php public function getTabColorInfo(): ?array ``` -------------------------------- ### Get Image Entry Full Path Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves the full path to an image file within the sheet's ZIP archive. ```php public function imageEntryFullPath(string $cell): ?string ``` -------------------------------- ### Skip Empty Cells and Rows Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Demonstrates how to iterate through rows while skipping empty cells and rows. Includes options to treat empty strings as empty cells and to consider rows with only whitespace as empty. ```php $sheet = $excel->sheet(); // Skip empty cells and empty rows foreach ($sheet->nextRow() as $rowNum => $rowData) { // handle $rowData } // Skip empty cells and cells with empty strings foreach ($sheet->nextRow([], Excel::TREAT_EMPTY_STRING_AS_EMPTY_CELL) as $rowNum => $rowData) { // handle $rowData } // Skip empty cells and empty rows (rows containing only whitespace characters are also considered empty) foreach ($sheet->nextRow([], Excel::TRIM_STRINGS | Excel::TREAT_EMPTY_STRING_AS_EMPTY_CELL) as $rowNum => $rowData) { // handle $rowData } ``` -------------------------------- ### Set Comment Prefix Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/95-api-class-csv-options.md Configures the character that signifies the start of a comment line in the CSV file. This helps in ignoring comment lines during parsing. ```php public function setCommentPrefix(?string $value): CsvOptions ``` -------------------------------- ### Get Style by Index Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves the style array associated with a given style index. Requires the style index as input. ```php public function styleByIdx($styleIdx): array ``` -------------------------------- ### CsvOptions Constructor Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/95-api-class-csv-options.md Initializes a new CsvOptions instance. Accepts an array of options to pre-configure the settings. ```php public function __construct(array $options = []) ``` -------------------------------- ### open() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Opens an XLSX file and returns an Excel object for further processing. ```APIDOC ## open() ### Description Opens an XLSX file and returns an Excel object for further processing. ### Method static open ### Parameters - **file** (string) - The path to the XLSX file. ``` -------------------------------- ### Iterate through rows with image handling Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Demonstrates looping through each row, checking for images in specific cells, and saving them. Also shows how to retrieve a list of images within a row and their blobs. ```php $sheet = $excel->sheet(); foreach ($sheet->nextRow() as $rowNum => $rowData) { // $rowData is array ['A' => ..., 'B' => ...] $addr = 'C' . $rowNum; if ($sheet->hasImage($addr)) { $sheet->saveImageTo($addr, $fullDirectoryPath); } // handling of $rowData here // ... } // OR foreach ($sheet->nextRow() as $rowNum => $rowData) { // handling of $rowData here // ... // get image list from current row $imageList = $sheet->getImageListByRow(); foreach ($imageList as $imageInfo) { $imageBlob = $sheet->getImageBlob($imageInfo['address']); } } ``` ```php foreach ($sheet->nextRow(['A' => 'One', 'B' => 'Two'], Excel::KEYS_FIRST_ROW) as $rowNum => $rowData) { // $rowData is array ['One' => ..., 'Two' => ...] // ... } ``` -------------------------------- ### Get Tab Color Configuration Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves the tab color configuration for the sheet. This is an alias for getTabColorConfig(). ```php public function getTabColorConfiguration(): ?array ``` -------------------------------- ### Get Shared String Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves a shared string from the workbook by its index. Returns the string or null if not found. ```php public function sharedString($stringId): ?string ``` -------------------------------- ### Get Current or Specified Sheet Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves the current default sheet or a specific sheet by its name. Returns the Sheet object or null if not found. ```php public function sheet(?string $name = null): ?Sheet ``` -------------------------------- ### id Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get the unique identifier for the sheet. ```APIDOC ## id() ### Description Get sheet ID. ### Method GET ### Endpoint /sheet/id ### Parameters _None_ ### Response #### Success Response (200) - **id** (string) - The unique identifier of the sheet. ### Response Example ```json { "id": "sheet1" } ``` ``` -------------------------------- ### __construct Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Initializes a new instance of the Sheet class. ```APIDOC ## __construct() ### Description Initializes a new instance of the Sheet class. ### Parameters * `string $sheetName` * `string $sheetId` * `string $file` * `string $path` * `$excel` ``` -------------------------------- ### Get Current Date Format Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves the currently configured date format string for the workbook. Returns null if not set. ```php public function getDateFormat(): ?string ``` -------------------------------- ### CsvReader Constructor Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/94-api-class-csv-reader.md Initializes a new instance of the CsvReader class. Requires the file path and optional CSV parsing options. ```php public function __construct(string $file, $options) ``` -------------------------------- ### getRowHeight Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get the height of a specified row. ```APIDOC ## getRowHeight(int $rowNumber) ### Description Get height of the row. ### Method GET ### Endpoint /sheet/row/{rowNumber}/height ### Parameters #### Path Parameters - **rowNumber** (int) - Required - The number of the row to get the height for. ### Response #### Success Response (200) - **height** (float|null) - The height of the row, or null if not found. ### Response Example ```json { "height": 30.0 } ``` ``` -------------------------------- ### Get Defined Names Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves an array of all defined names within the workbook. Useful for accessing named ranges. ```php public function getDefinedNames(): array ``` -------------------------------- ### Get Sheet State Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Returns the state of the worksheet as a string. This is often used in conjunction with isHidden() and isVisible(). ```php state() ``` -------------------------------- ### Reading Cells from a Specific Sheet Using Defined Area Name Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Demonstrates how to get a specific sheet and set a read area by its defined name on that sheet. ```php $sheet = $excel->getSheet('Demo1')->setReadArea('Headers'); $cells = $sheet->readCells(); ``` -------------------------------- ### Read rows using readNextRow() method Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Illustrates how to initialize the internal read generator using reset() and then sequentially read rows with readNextRow(). Shows resetting the generator to read from the beginning. ```php // Init the internal read generator $sheet->reset(['A' => 'One', 'B' => 'Two'], Excel::KEYS_FIRST_ROW); // read the first row $rowData = $sheet->readNextRow(); var_dump($rowData); // Read the next 3 rows for ($i = 0; $i < 3; $i++) { $rowData = $sheet->readNextRow(); var_dump($rowData); } // Reset the internal generator and read all rows starting from the first one $sheet->reset(['A' => 'One', 'B' => 'Two'], Excel::KEYS_FIRST_ROW); $result = []; while ($rowData = $sheet->readNextRow()) { $result[] = $rowData; } var_dump($result); ``` -------------------------------- ### getDataValidations Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get data validation rules. ```APIDOC ## getDataValidations() ### Description Get data validation rules. ### Parameters None ``` -------------------------------- ### Open XLSX File Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Opens an XLSX file and returns an Excel instance for further processing. This is a static factory method. ```php public static function open(string $file): Excel ``` -------------------------------- ### dimensionArray Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get sheet dimension as an array. ```APIDOC ## dimensionArray() ### Description Get sheet dimension as an array. ### Parameters None ``` -------------------------------- ### CsvOptions Constructor Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/95-api-class-csv-options.md Initializes a new CsvOptions instance. It can optionally accept an array of options to pre-configure the instance. ```APIDOC ## __construct() ### Description CsvOptions constructor. ### Parameters * `array $options` - An array of options to initialize the CsvOptions with. ``` -------------------------------- ### Get Row Style Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves the style information for a specific row. Can return a flat array of styles. ```php public function getRowStyle(int $row, ?bool $flat = false): array ``` -------------------------------- ### Reset and Read Rows Sequentially Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Shows an alternative method to reset the reader and read rows one by one. Useful for processing rows sequentially after initial configuration. ```php $sheet->reset([], Excel::TRIM_STRINGS | Excel::TREAT_EMPTY_STRING_AS_EMPTY_CELL); $rowData = $sheet->readNextRow(); // do something $rowData = $sheet->readNextRow(); // handle next row // ... ``` -------------------------------- ### Get Metadata Image by Index Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves the file name of an image from the workbook's metadata, specified by its index. Returns the image name or null. ```php public function metadataImage(int $vmIndex): ?string ``` -------------------------------- ### Get Inner File List Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves a list of all inner files contained within the XLSX package. Returns an array of file names. ```php public function innerFileList(): array ``` -------------------------------- ### Return All Options as Array Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/95-api-class-csv-options.md Retrieves all currently configured CSV parsing options as an associative array. ```APIDOC ## toArray() ### Description Return all options as array. ### Parameters _None_ ``` -------------------------------- ### getImageListByRow Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get image list by row number. ```APIDOC ## getImageListByRow() ### Description Get image list by row number. ### Parameters * `$row` ``` -------------------------------- ### Select First Sheet as Default Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Sets the first sheet as the default sheet and returns it. An areaRange can be specified for data retrieval. ```php selectFirstSheet(?string $areaRange = null, ?bool $firstRowKeys = false) ``` -------------------------------- ### Get Date Formatter Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves the currently set custom date formatter. Returns the callable or boolean/null if not set. ```php public function getDateFormatter(): callable|\Closure|bool|null ``` -------------------------------- ### withHeader() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/94-api-class-csv-reader.md Enables header mode, treating the first row as a header. ```APIDOC ## withHeader() ### Description Enables header mode. Treats the first row of the CSV file as a header row and returns subsequent rows as associative arrays keyed by column names. ### Parameters _None_ ``` -------------------------------- ### getReadRowNum Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get the number of the last row that was read from the spreadsheet. ```APIDOC ## getReadRowNum() ### Description Get the number of the last row read. ### Method GET ### Endpoint /sheet/readRowNum ### Parameters _None_ ### Response #### Success Response (200) - **readRowNum** (int) - The number of the last row read. ### Response Example ```json { "readRowNum": 150 } ``` ``` -------------------------------- ### Get Sheet ID Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves the unique identifier for the sheet. ```php public function id(): string ``` -------------------------------- ### Get Tab Color Configuration Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Retrieves an array containing the tab color configuration for the sheet. This allows you to programmatically access the sheet's tab color. ```php getTabColorConfiguration() ``` -------------------------------- ### getColumnAttributes Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get column attributes (width, style, etc). ```APIDOC ## getColumnAttributes() ### Description Get column attributes (width, style, etc). ### Parameters * `int|string $col` ``` -------------------------------- ### getOptions() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/94-api-class-csv-reader.md Retrieves the current CSV parsing options. ```APIDOC ## getOptions() ### Description Retrieves the current CSV parsing options. ### Parameters _None_ ``` -------------------------------- ### Get Sheet by Name or ID Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves a specific sheet by its name or ID. Allows setting a read area range and specifying if the first row contains keys. ```php public function getSheet(?string $name = null, ?string $areaRange = null, ?bool $firstRowKeys = false): Sheet ``` ```php public function getSheetById(int $sheetId, ?string $areaRange = null, ?bool $firstRowKeys = false): Sheet ``` -------------------------------- ### firstRow Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get number of the first row in the read area. ```APIDOC ## firstRow() ### Description Get number of the first row in the read area. ### Parameters None ``` -------------------------------- ### Read All Workbook Styles Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Reads and returns all styles defined within the workbook. No parameters are required. ```php public function readStyles(): array ``` -------------------------------- ### Get Default or Specified Sheet Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Returns the default sheet or a specific sheet by name. The optional areaRange parameter can limit the data read from the sheet. ```php sheet(?string $name = null) ``` -------------------------------- ### firstCol Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get letter of the first column in the read area. ```APIDOC ## firstCol() ### Description Get letter of the first column in the read area. ### Parameters None ``` -------------------------------- ### Create CsvOptions Instance Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/95-api-class-csv-options.md A static factory method to create a new CsvOptions instance, optionally with initial configuration. ```APIDOC ## create() ### Description Create CsvOptions instance. ### Parameters * `array $options` - An array of options to initialize the CsvOptions with. ``` -------------------------------- ### Simple XLSX Read - All Columns Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Opens an XLSX file and reads all data into a two-dimensional array, indexed by column letter and then by row number. ```php // Read all columns in two-dimensional array (COL x ROW) $result = $excel->readColumns(); ``` -------------------------------- ### Create XML Reader Object Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Factory method to create an XML reader instance for a given file. Allows for optional parser properties. ```php public static function createReader(string $file, ?array $parserProperties = []): Interfaces\InterfaceXmlReader ``` -------------------------------- ### getImageMimeType Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get image MIME type. Requires fileinfo extension. ```APIDOC ## getImageMimeType() ### Description Get image MIME type. Requires fileinfo extension. ### Parameters * `string $cell` ``` -------------------------------- ### Get Sheet by Name Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Retrieves a specific sheet by its name. You can optionally specify an areaRange to limit the data and set firstRowKeys to true if the first row contains headers. ```php getSheet(string $name, ?string $areaRange = null, ?bool $firstRowKeys = false) ``` -------------------------------- ### Enable Header Mode Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/94-api-class-csv-reader.md Enables header mode, treating the first row as a header. Subsequent rows will be returned as associative arrays keyed by column names. Returns the CsvReader instance for method chaining. ```php public function withHeader(): CsvReader ``` -------------------------------- ### minActualRow Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get the number of the first actual row that contains data in the sheet. ```APIDOC ## minActualRow() ### Description Get the first actual row number. ### Method GET ### Endpoint /sheet/minActualRow ### Parameters _None_ ### Response #### Success Response (200) - **minActualRow** (int) - The number of the first row with data. ### Response Example ```json { "minActualRow": 1 } ``` ``` -------------------------------- ### minActualColumn Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get the letter of the first actual column that contains data in the sheet. ```APIDOC ## minActualColumn() ### Description Get the first actual column letter. ### Method GET ### Endpoint /sheet/minActualColumn ### Parameters _None_ ### Response #### Success Response (200) - **minActualColumn** (string) - The letter of the first column with data. ### Response Example ```json { "minActualColumn": "A" } ``` ``` -------------------------------- ### maxActualRow Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get the number of the last actual row that contains data in the sheet. ```APIDOC ## maxActualRow() ### Description Get the last actual row number. ### Method GET ### Endpoint /sheet/maxActualRow ### Parameters _None_ ### Response #### Success Response (200) - **maxActualRow** (int) - The number of the last row with data. ### Response Example ```json { "maxActualRow": 100 } ``` ``` -------------------------------- ### Create CsvOptions Instance Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/95-api-class-csv-options.md A static factory method to create and return a new CsvOptions instance. It can be initialized with an array of options. ```php public static function create(array $options = []): CsvOptions ``` -------------------------------- ### maxActualColumn Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get the letter of the last actual column that contains data in the sheet. ```APIDOC ## maxActualColumn() ### Description Get the last actual column letter. ### Method GET ### Endpoint /sheet/maxActualColumn ### Parameters _None_ ### Response #### Success Response (200) - **maxActualColumn** (string) - The letter of the last column with data. ### Response Example ```json { "maxActualColumn": "Z" } ``` ``` -------------------------------- ### Select First Sheet Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Selects the first sheet in the workbook as the default sheet for subsequent operations. Optionally specify an area range and whether the first row should be treated as keys. ```php public function selectFirstSheet(?string $areaRange = null, ?bool $firstRowKeys = false): Sheet ``` -------------------------------- ### Get Row Attributes Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves attributes for a specific row, such as height and style. ```php public function getRowAttributes(int $row): array ``` -------------------------------- ### Configuring CSV Parsing with CsvOptions Object Source: https://github.com/avadim483/fast-excel-reader/blob/main/README-CSV.md Opens a CSV file with custom parsing options set using the `CsvOptions` object and its fluent setter methods. ```php use avadim\FastExcelReader\Csv\CsvOptions; use avadim\FastExcelReader\Excel; $options = new CsvOptions($options) ->setDelimiter(';') ->setEnclosure('"') ->setEncoding('UTF-8') ->setTrimFields(true) ->setSkipEmptyLines(true) ; $csv = Excel::openCsv($file, $options); ``` -------------------------------- ### Advanced Excel Reading with Specific Areas and Formats Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Illustrates advanced usage for reading specific data areas within sheets, setting date formats, and defining custom column keys. Requires importing the Excel class. ```php use \avadim\FastExcelReader\Excel; $file = __DIR__ . '/files/demo-02-advanced.xlsx'; $excel = Excel::open($file); $result = [ 'sheets' => $excel->getSheetNames() // get all sheet names ]; $result['#1'] = $excel // select sheet by name ->selectSheet('Demo1') // select area with data where the first row contains column keys ->setReadArea('B4:D11', true) // set date format ->setDateFormat('Y-m-d') // set key for column 'C' to 'Birthday' ->readRows(['C' => 'Birthday']); // read other arrays with custom column keys // and in this case we define range by columns only $columnKeys = ['B' => 'year', 'C' => 'value1', 'D' => 'value2']; $result['#2'] = $excel ->selectSheet('Demo2', 'B:D') ->readRows($columnKeys); $result['#3'] = $excel ->setReadArea('F5:H13') ->readRows($columnKeys); ``` -------------------------------- ### Return All Options as Array Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/95-api-class-csv-options.md Converts all currently set CSV parsing options into an associative array. This is useful for inspection or logging. ```php public function toArray(): array ``` -------------------------------- ### Magic Getter for Options Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/95-api-class-csv-options.md Allows retrieving CSV options using magic getter syntax. ```APIDOC ## __get() ### Description Magic getter for options. ### Parameters * `string $name` - The name of the option to retrieve. ``` -------------------------------- ### dimension Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get sheet dimension range (e.g. "A1:C10"). ```APIDOC ## dimension() ### Description Get sheet dimension range (e.g. "A1:C10"). ### Parameters None ``` -------------------------------- ### Select Sheet by Name Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Selects a default sheet by its name. Allows specifying an area range and whether the first row should be treated as keys. ```php public function selectSheet(string $name, ?string $areaRange = null, ?bool $firstRowKeys = false): Sheet ``` -------------------------------- ### Set Temporary Directory Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Configures the directory used for storing temporary files during processing. Accepts a string path to the desired directory. ```php public static function setTempDir($tempDir) ``` -------------------------------- ### Basic CSV Reading Source: https://github.com/avadim483/fast-excel-reader/blob/main/README-CSV.md Opens a CSV file and iterates through its rows using the `nextRow()` method. Each row is returned as a simple numerical array. ```php use avadim\FastExcelReader\Excel; $file = 'data.csv'; $csv = Excel::openCsv($file); foreach ($csv->nextRow() as $rowNum => $row) { // $row is a simple numerical array print_r($row); } ``` -------------------------------- ### Get Min Actual Row Number Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves the number of the first row that contains data. ```php public function minActualRow(): int ``` -------------------------------- ### Get Min Actual Column Letter Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves the letter of the first column that contains data. ```php public function minActualColumn(): string ``` -------------------------------- ### Magic Isset for Options Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/95-api-class-csv-options.md Allows checking for the existence of CSV options using magic isset syntax. ```APIDOC ## __isset() ### Description Magic isset for options. ### Parameters * `string $name` - The name of the option to check. ``` -------------------------------- ### Get Merged Range for Cell Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves the merged range address for a given cell address. ```php public function mergedRange(string $cellAddress): ?string ``` -------------------------------- ### Get Max Actual Row Number Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves the number of the last row that contains data. ```php public function maxActualRow(): int ``` -------------------------------- ### openCsv() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Opens a CSV file for reading. It supports custom options for parsing the CSV data. ```APIDOC ## openCsv() ### Description Open CSV file. ### Method ```php public static function openCsv(string $file, $options): Csv\CsvReader ``` ### Parameters #### Path Parameters - **file** (string) - Required - The path to the CSV file. - **options** (CsvOptions|array|null) - Optional - Options for parsing the CSV file. ``` -------------------------------- ### Get Max Actual Column Letter Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves the letter of the last column that contains data. ```php public function maxActualColumn(): string ``` -------------------------------- ### Get Last Read Row Number Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Returns the number of the last row that was read by the reader. ```php public function getReadRowNum(): int ``` -------------------------------- ### Get Row Height Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Retrieves the height of a specific row in a sheet. Row indexing is 1-based. ```php $excel = Excel::open($file); $sheet = $excel->selectSheet('SheetName'); // Get the height of row 1 $rowHeight = $sheet->getRowHeight(1); echo $rowHeight; // Example: 15 ``` -------------------------------- ### Simple XLSX Read - All Rows Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Opens an XLSX file and reads all data into a two-dimensional array, indexed by row number and then by column letter. ```php // Read all rows in two-dimensional array (ROW x COL) $result = $excel->readRows(); ``` -------------------------------- ### Get Column Width Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Retrieves the width of a specific column in a sheet. Column indexing is 1-based. ```php $excel = Excel::open($file); $sheet = $excel->selectSheet('SheetName'); // Get the width of column 1 (column 'A') $columnWidth = $sheet->getColumnWidth(1); echo $columnWidth; // Example: 11.85 ``` -------------------------------- ### Configuring CSV Parsing with an Array Source: https://github.com/avadim483/fast-excel-reader/blob/main/README-CSV.md Opens a CSV file with custom parsing options provided as an associative array. Options include delimiter, enclosure, encoding, and more. ```php use avadim\FastExcelReader\Excel; $options = [ 'delimiter' => ';', 'enclosure' => '"', 'encoding' => 'UTF-8', 'trim_fields' => true, 'skip_empty_lines' => true, ]; $csv = Excel::openCsv($file, $options); ``` -------------------------------- ### createSheet() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Creates a sheet object for a given sheet name, ID, file, path, and Excel instance. ```APIDOC ## createSheet() ### Description Creates a sheet object for a given sheet name, ID, file, path, and Excel instance. ### Method static createSheet ### Parameters - **sheetName** (string) - The name of the sheet. - **sheetId** (int|string) - The ID of the sheet. - **file** (string) - The path to the Excel file. - **path** (string) - The path to the sheet data. - **excel** (Excel) - The Excel instance. ``` -------------------------------- ### Enable Header Mode in Sheet Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Use this method to treat the first row of the read area as a header. Subsequent rows will be returned as associative arrays keyed by column names. No parameters are required. ```php public function withHeader(): Sheet ``` -------------------------------- ### getMergedCells Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Get merged cells. Returns an array where keys are the minimum cell address and values are the merged range. ```APIDOC ## getMergedCells() ### Description Get merged cells. Returns an array [min_cell => range]. ### Method GET ### Endpoint /sheet/{sheetName}/mergedCells ### Parameters _None_ ### Response #### Success Response (200) - **mergedCells** (array) - An associative array where keys are the minimum cell address and values are the merged range strings. ### Response Example ```json { "mergedCells": { "A1": "A1:C5", "D10": "D10:E12" } } ``` ``` -------------------------------- ### Magic Setter for Options Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/95-api-class-csv-options.md Allows setting CSV options using magic setter syntax. ```APIDOC ## __set() ### Description Magic setter for options. ### Parameters * `string $name` - The name of the option to set. * `mixed $value` - The value to set for the option. ``` -------------------------------- ### Open CSV File Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Opens a CSV file for reading. Accepts a file path and optional CSV parsing options. ```php public static function openCsv(string $file, $options): Csv\CsvReader ``` -------------------------------- ### saveImageTo() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Saves an image to a directory. ```APIDOC ## saveImageTo() ### Description Saves an image to a directory. ### Method (Not specified, likely a method call) ### Endpoint (Not applicable, SDK method) ### Parameters #### Path Parameters (None specified) #### Query Parameters (None specified) #### Request Body (None specified) ### Request Example (Not specified) ### Response #### Success Response (No specific return value mentioned) #### Response Example (Not specified) ``` -------------------------------- ### PHP readColumnsWithStylesFrom Method Signature Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Sets a read area and returns cell values and styles as a two-dimensional array, organized by column and row. ```php public function readColumnsWithStylesFrom(string $areaRange, $columnKeys, ?int $resultMode = null): array ``` -------------------------------- ### selectFirstSheet() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Selects the first sheet as the default sheet for subsequent operations. ```APIDOC ## selectFirstSheet() ### Description Selects the first sheet as the default sheet for subsequent operations. ### Method ```php public function selectFirstSheet(?string $areaRange = null, ?bool $firstRowKeys = false): Sheet ``` ### Parameters #### Query Parameters - **areaRange** (string|null) - Optional - Specifies a range within the sheet to select. - **firstRowKeys** (bool|null) - Optional - If true, uses the first row as keys. ``` -------------------------------- ### readStyles() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Reads all workbook styles. ```APIDOC ## readStyles() ### Description Reads all workbook styles. ### Method ```php public function readStyles(): array ``` ### Parameters _None_ ``` -------------------------------- ### from Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Set top left of read area. Alias of setReadArea(). ```APIDOC ## from() ### Description Set top left of read area. Alias of setReadArea(). ### Parameters * `string $topLeftCell` * `bool|null $firstRowKeys` ``` -------------------------------- ### Set Date Format Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Sets the date format for the sheet. Returns the Sheet instance for chaining. ```php public function setDateFormat($dateFormat): Sheet ``` -------------------------------- ### Get Merged Cells Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Retrieves an array of merged cell ranges. The keys are the minimum cell addresses and the values are the corresponding ranges. ```php public function getMergedCells(): ?array ``` -------------------------------- ### selectSheet() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Selects a default sheet by its name. ```APIDOC ## selectSheet() ### Description Selects the default sheet by its name. ### Method ```php public function selectSheet(string $name, ?string $areaRange = null, ?bool $firstRowKeys = false): Sheet ``` ### Parameters #### Query Parameters - **name** (string) - Required - The name of the sheet to select. - **areaRange** (string|null) - Optional - Specifies a range within the sheet to select. - **firstRowKeys** (bool|null) - Optional - If true, uses the first row as keys. ``` -------------------------------- ### Create Sheet Object Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Creates a new sheet object for an Excel file. Requires sheet name, ID, file path, and the Excel instance. ```php public static function createSheet(string $sheetName, $sheetId, $file, $path, $excel): Interfaces\InterfaceSheetReader ``` -------------------------------- ### Read Columns with Styles by Keys Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves cell values and their corresponding styles as a two-dimensional array, organized by column, from the default sheet. Allows specifying column keys and a result mode. ```php public function readColumnsWithStyles($columnKeys, ?int $resultMode = null): array ``` -------------------------------- ### Set Read Area Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Sets the top-left and bottom-right boundaries for reading data within the sheet. Can accept a full range or just a starting cell. ```php setReadArea('C3:AZ28'); // set top left and right bottom of read area ``` ```php setReadArea('C3'); // set top left only ``` -------------------------------- ### formatDate() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Formats a given date value according to a specified format string and style index. This is useful for consistent date representation in output. ```APIDOC ## formatDate() ### Description Format date value. ### Method ```php public function formatDate($value, $format, $styleIdx): false|mixed|string ``` ### Parameters #### Path Parameters - **value** (mixed) - Required - The date value to format. - **format** (string|null) - Optional - The desired format string for the date. - **styleIdx** (int|null) - Optional - The style index to apply to the date formatting. ``` -------------------------------- ### createReader() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Creates an XML reader object for processing XML files, with optional parser properties. ```APIDOC ## createReader() ### Description Creates an XML reader object for processing XML files, with optional parser properties. ### Method static createReader ### Parameters - **file** (string) - The path to the XML file. - **parserProperties** (array|null) - Optional array of parser properties. ``` -------------------------------- ### Get Min Row from Dimension Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Determines the minimum row number based on the sheet's dimension value, optionally within a specified range. ```php public function minRow(?string $range = null): int ``` -------------------------------- ### Get Min Column from Dimension Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Determines the minimum column letter based on the sheet's dimension value, optionally within a specified range. ```php public function minColumn(?string $range = null): string ``` -------------------------------- ### getFirstSheet() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Returns the first sheet of the workbook. Optionally, a specific area range can be specified, and the first row can be treated as keys. ```APIDOC ## getFirstSheet() ### Description Returns the first sheet as default. ### Method ```php public function getFirstSheet(?string $areaRange = null, ?bool $firstRowKeys = false): Sheet ``` ### Parameters #### Path Parameters - **areaRange** (string|null) - Optional - The range of cells to read from the sheet (e.g., 'A1:C10'). - **firstRowKeys** (bool|null) - Optional - If true, the first row will be treated as keys. ``` -------------------------------- ### Get Max Row from Dimension Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Determines the maximum row number based on the sheet's dimension value, optionally within a specified range. ```php public function maxRow(?string $range = null): int ``` -------------------------------- ### Get Max Column from Dimension Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/92-api-class-sheet.md Determines the maximum column letter based on the sheet's dimension value, optionally within a specified range. ```php public function maxColumn(?string $range = null): string ``` -------------------------------- ### Custom Row Reading with Callback Function Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Explains how to use the `readCallback` method for full control over the reading process. The callback function receives row, column, and value, and can interrupt reading by returning true. ```php use \avadim\FastExcelReader\Excel; $excel = Excel::open($file); $result = []; $excel->readCallback(function ($row, $col, $val) use(&$result) { // Any manipulation here $result[$row][$col] = (string)$val; // if the function returns true then data reading is interrupted return false; }); var_dump($result); ``` -------------------------------- ### Simple XLSX Read - All Cells Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Opens an XLSX file and reads all cell values into a flat associative array keyed by cell coordinates (e.g., A1, B2). ```php use \avadim\FastExcelReader\Excel; $file = __DIR__ . '/files/demo-00-simple.xlsx'; // Open XLSX-file $excel = Excel::open($file); // Read all values as a flat array from current sheet $result = $excel->readCells(); ``` -------------------------------- ### mediaImageFiles() Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Retrieves a list of image files located in the workbook's media folder. This provides direct access to the image assets. ```APIDOC ## mediaImageFiles() ### Description Get list of media image files in the workbook. ### Method ```php public function mediaImageFiles(): array ``` ### Parameters _None_ ``` -------------------------------- ### Reading Cells Using Defined Workbook Names Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Shows how to set the read area using a defined name within the workbook, which can refer to a specific range on a sheet. ```php $excel->setReadArea('Values'); $cells = $excel->readCells(); ``` -------------------------------- ### Check and Get Merged Cell Range Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Provides methods to check if a cell is part of a merged range and to retrieve the specific merged range it belongs to. ```php if ($sheet->isMerged('B3')) { $range = $sheet->mergedRange('B3'); } ``` -------------------------------- ### Get Maximal Column Letter Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Returns the maximal column letter from the sheet's properties. This indicates the last column with data according to the dimension property. ```php maxColumn() ``` -------------------------------- ### Check for Extra Images Source: https://github.com/avadim483/fast-excel-reader/blob/main/docs/91-api-class-excel.md Verifies if there are any 'extra' images in the workbook (in media folder but not in drawings). Returns a boolean. ```php public function hasExtraImages(): bool ``` -------------------------------- ### Get Sheet by ID Source: https://github.com/avadim483/fast-excel-reader/blob/main/README.md Retrieves a specific sheet using its unique ID. Similar to getSheet, you can specify an areaRange and whether the first row contains keys. ```php getSheetById(int $sheetId, ?string $areaRange = null, ?bool $firstRowKeys = false) ```