svenkuegler/php-csv-validator

Simple PHP Class to validate CSV files / Single Rows

0.1.0 2016-03-31 14:35 UTC

This package is not auto-updated.

Last update: 2025-06-27 21:34:25 UTC


README

Build Status Code Climate Test Coverage

Simple PHP Class to Validate CSV Files

Installation

via Composer:

composer require svenkuegler/php-csv-validator

Usage

Quick Start

Simple example to validate a file against a Schema.

require 'vendor/autoload.php';

$validator = new PhpCsvValidator();
$validator->loadSchemeFromFile("tests/files/example-scheme2.json");

if($validator->isValidFile("tests/files/example.csv")) {
    echo "File is Valid";
} else {
    echo "File is Invalid!";
}

Schema

...

Exception handling

...

Running Tests

$ phpunit

Contributing

Feel free to send pull requests or create issues if you come across problems or have great ideas. Any input is appreciated!

License

This code is published under the The MIT License. This means you can do almost anything with it, as long as the copyright notice and the accompanying license file is left intact.