Converter
Paste XLSX below, press Convert, and copy the PHP array output.
Picking a file reads its first sheet into the input box.
Convert XLSX to PHP array free in your browser. Paste your XLSX on the left, press Convert, and copy clean PHP array on the right. No sign-up, no uploads.
Paste XLSX below, press Convert, and copy the PHP array output.
Picking a file reads its first sheet into the input box.
When you pick a file, the SheetJS library reads the first worksheet into a grid in memory, and the first row becomes the column headers for every row below it. That grid is exactly what you see staged in the input box as JSON, and pressing Convert reshapes it into PHP array with types preserved from the cells.
The snippet assigns $data, so rename the variable or wrap it in a return statement if you are building a config file. It is also a quick way to seed Laravel or WordPress fixtures: convert, paste into a seeder, and the nested array() syntax works on every supported PHP version.