shfarzam/data-validation

A PHP library for data validation including email, URL, and password validation methods.

v1.0.2 2023-12-15 23:26 UTC

This package is auto-updated.

Last update: 2024-10-16 01:27:25 UTC


README

DataValidation

DataValidation is a PHP package designed to simplify data validation tasks. It provides methods to validate email addresses, URLs, and passwords.

Installation

You can install this package via Composer:

composer require shfarzam/data-validation

Usage

Email Validation

use shfarzam\DataValidation\Validator;

if (Validator::validateEmail('example@example.com')) {
    // Valid email address
} else {
    // Invalid email address
}

URL Validation

use shfarzam\DataValidation\Validator;

if (Validator::validateURL('https://www.example.com')) {
    // Valid URL
} else {
    // Invalid URL
}

Password Validation

use shfarzam\DataValidation\Validator;

$password = 'securepassword';

// validatePassword(Password, MinLenght, CheckComplexity)
if (Validator::validatePassword($password, 8, True / False)) {
    // Valid password
} else {
    // Invalid password
}

About

This package is a lightweight solution for common data validation tasks in PHP projects. It aims to provide a straightforward interface for validating emails, URLs, and passwords without extensive configuration.

License

This project is licensed under the Proprietary License - see the LICENSE file for details.