PHP code example of corealg / excel-validator
1. Go to this page and download the library: Download corealg/excel-validator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
corealg / excel-validator example snippets
// initilaize Core Excel Validator
$excelValidator = new ExcelValidator();
// make rules
$rules = [
'first_name' => 'heet
$response = $excelValidator->validate($_FILES['file'], $rules);
// Success response
// [
// "status" => "success"
// "code" => 200
// "errors" => []
// "data" => [
// 1 => [
// "first_name" => "Mizanur"
// "last_name" => "Rahman"
// "email" => "[email protected]"
// "joining_date" => "2021-01-01"
// ]
// ]
// ]
// Validation error Response
// [
// "status" => "error"
// "code" => 422
// "errors" => [
// 0 => "The First name is
$rule = [
'first_name' => '