Download the PHP package originphp/validation without Composer

On this page you can find all versions of the php package originphp/validation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package validation

Validation

license build coverage

This provides a Validation library and the Validator class for setting up and running validation rules on arrays of data.

Installation

To install this package

Validation Library

For example

The full list of validation rules are listed below, after the next section.

Validator

To validate an array of values

Rule options:

You can also use custom validation rules using

Or to use a closure

The Validator uses the Validation rules and has 3 additional validation rules built in, required, optional, and present.

These rules should be called first, and for required and present, if they fail no further validation rules will run.

ValidateTrait

You can add validation any Plain Old PHP Object.

Then you can check its valid

You can

Validation Rules

accepted

Validates a value is accepted (checkbox is checked)

after

Validates a date is after a certain date, dates are passed to the strtotime function.

alpha

Validates a string only contains alphabetic characters from the default locale

alphaNumeric

Validates a string only contains alphanumeric characters from the default locale

array

Validates a value is an array

before

Validates a date is before a certain date, dates are passed to the strtotime function.

boolean

Validates a value is a boolean type

creditCard

Validates a credit card number

All regex rules written from scratch using current IIN ranges, so whilst they are accurate the rules are not mature yet.

date

Validates a date using a format compatible with the PHP DateTime class.

dateFormat

Validates a date using a format compatible with the PHP DateTime class, this is used by Validation::date, Validation::time, and Validation::dateTime.

The format, which is the second argument is required

dateTime

Validates a datetime using a format compatible with the PHP DateTime class.

decimal

Validates a value is a float. Alias for float

email

Validation for an email address

You can also check that the email address has valid MX records using the getmxrr function.

equalTo

Validates a value is equal to another value, only values are compared.

extension

Validates a value has an extension. If an array is supplied it will look

You can also check a file that has been uploaded with the correct extension.

float

Validates a value is a float.

fqdn

Validates a string is Fully Qualified Domain Name (FQDN).

You can also check the DNS records using checkdnsrr to ensure that is really valid and not just looks like its valid.

greaterThan

Validates a value is greater than

greaterThanOrEqual

Validates a value is greater than or equals a value.

hex

Validates a hexadecimal string.

hexColor

Validates a value is a hex color

iban

Validates a value is an IBAN number

in

Validates a value is in a list

integer

Validates a value is an integer

ip

Validates a value is an IP Address, by default it validates as either IPV4 or IPV6.

To validate only IPV4 or IPV6

ipRange

Validates an IP address is in a range.

json

Validates a value is a JSON string.

length

Validates a string has a certain length.

lessThan

Validates a value is less than another a value.

lessThanOrEqual

Validates a value is less than or equal to another a value.

lowercase

Validates a string is in lowercase.

luan

Validates a number using the LUAN algoritm.

macAddress

Validates a string is a valid mac address.

maxLength

Validates a string has a maximum length.

md5

Validates a string is a MD5 hash.

You can also allow it to be case insensitive

mimeType

Validates a file has a particular mime type.

minLength

Validates a string has a minimum length.

notBlank

Validates a value is not empty and has anything other than whitespaces.

notEmpty

Validates a value is not empty, a value is empty

notIn

Validates a value is not in an array of values.

numeric

Validates a value is an integer or a float.

present

Validates an array has a key.

range

Validates a number or float is within a range.

regex

Validates a string using a REGEX pattern.

string

Validates that a value is a string

time

Validates a string is a time.

upload

Validates a file upload was successful.

You can also allow optional file upload, meaning if no file is upload then it will return true if there was no error uploading it.

uppercase

Validates a string is uppercase.

url

Validates a string is an URL.

uuid

Validates a string is a UUID

You can also allow uppercase


All versions of validation with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package originphp/validation contains the following files

Loading the files please wait ....