MNB PHPExcelDeveloper Guide
Getting started

Choose a Reader Journey

Follow a focused sequence for your first workbook, a user upload, a large XLSX file, or an Excel-to-database import.

Updated

PHP 8.1+Full packageIndividual XLSXGuided path
Available sincev2.0.5Last API changev2.0.5Version guide
LevelBeginner to advancedReading time7 minPackagemnb/mnb-phpexcel or mnb/mnb-phpexcel-xlsx

What you will learn

  • Choose the shortest documentation path for the job in front of you.
  • Move from a successful first read to production validation and error handling.
  • Avoid mixing small-file, upload, large-file, and database-import concerns too early.

Choose the journey that matches your job#

  1. Start with a known fixture

    Use a small downloadable workbook before debugging a customer file. This confirms installation, autoloading, and basic reader behavior.

  2. Inspect before selecting

    Read workbook metadata and worksheet names before assuming a sheet, header row, or row count.

  3. Configure before consuming

    Set the header row, empty-row policy, ranges, limits, and column projection before calling a terminal method.

  4. Choose a terminal method intentionally

    Use rows() for streaming, toArray() for small collected results, and structured output when you need source and skipped-row counts.

  5. Finish with a safe boundary

    Catch MnbExcelException, log structured debug context, and return a short public message.

Use the sample workbooks while learning#

The sample library gives every journey a predictable workbook with known sheets, headers, rows, formulas, and intentional validation failures.

Open sample workbooks