sumocoders / validation
Simple PHP validation library
Installs: 2 640
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 9
Forks: 2
Open Issues: 0
Requires (Dev)
- phpspec/phpspec: 2.0.*@dev
This package is not auto-updated.
Last update: 2024-12-21 18:36:48 UTC
README
A simple validation library for e.g.: IBAN and VAT numbers
Validators
- IBAN
- VAT
- Telephone numbers (currently only BE fixed and mobile numbers)
Getting started
Requirements
- php 5.3
- composer
Usage
1. Install this package in your project using composer
in your composer.json
file:
{ "require": { "sumocoders/validation": "0.3.0" } }
2. Require the composer autoloader in your project
<?php require_once __DIR__ . '/vendor/autoload.php';
3. Create a validator instance for iban
<?php require_once __DIR__ . '/vendor/autoload.php'; // Create validator instance $ibanValidator = new SumoCoders\Validation\IbanValidator(); // Sanitize iban code input: $validIbanFormat = $ibanValidator->sanitize($input); // Validate iban code: if ($ibanValidator->validate($validIbanFormat)) { // It's a valid iban code! }