frantzley/excel-to-json
Composer 安装命令:
composer require frantzley/excel-to-json
包简介
A PHP package to convert Excel files into JSON easily.
README 文档
README
ExcelToJson is a simple and reliable PHP library that allows developers to quickly convert Excel spreadsheets into JSON format. It supports both .xls and .xlsx files and handles empty headers gracefully by automatically generating keys.
With optional output to a JSON file, it’s perfect for APIs, data migration, reporting, or any project where you need to transform Excel data into structured JSON. Designed for PHP 8+, it integrates seamlessly into your projects and comes with PHPUnit tests for easy validation.
Key Features:
----> Convert Excel files to JSON effortlessly.
----> Supports .xls and .xlsx.
----> Auto-generates keys for empty headers.
----> Pretty-printed JSON with Unicode support.
----> Optional JSON output to a file (Will be on the Next Update).
----> Compatible with modern PHP (8.0+).
Installation
Require the package via Composer:
composer require frantzley/excel-to-json
Usage
<?php require 'vendor/autoload.php'; use Frantzley\ExcelToJson\ExcelToJson; $converter = new ExcelToJson(); // Convert Excel file to JSON $json = $converter->convert('/path/to/your/file.xlsx'); // Replace with your file path ( ranplase li pa chemen kote fichye ou an lokalize an ) echo $json;
Testing
Run unit tests with PHPUnit:
vendor/bin/phpunit tests
License
MIT
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-12