Documentation

Validator
in package

Class Validator.

Table of Contents

alnum()  : bool
Function verifies if given value contains only words or digits.
alnumSpace()  : bool
Function verifies if given value contains only words, digits or space.
base64()  : bool
Check base64.
bool()  : bool
Function verifies if given value can be recognized as bool.
date()  : bool
Function verifies if given value is compatible with default data format.
dateInUserFormat()  : bool
Function verifies if given value is compatible with user’s date format.
dateTime()  : bool
Function verifies if given value is compatible with default date and time format.
dateTimeInIsoFormat()  : bool
Function verifies if given value is compatible with date time in ISO format.
dateTimeInUserFormat()  : bool
Function verifies if given value is compatible with user’s date and time format.
dbName()  : bool
Function checks if given value is correct database name (mysql).
dbType()  : bool
Function checks if given value is database type.
dbUserName()  : bool
Function checks if given value is valid db user name.
dirName()  : bool
Check directory name.
domain()  : bool
Function checks if given value is domain.
email()  : bool
Function checks if given value is email.
emails()  : bool
Function checks if given value is email.
float()  : bool
Function verifies if given value is float type.
floatIsEqual()  : bool
Check if floating point numbers are equal.
floatIsEqualUserCurrencyDecimals()  : bool
Check if floating point numbers are equal. Get the precision of the number from the user's settings.
fontIcon()  : bool
Check font icon name.
integer()  : bool
Function verifies if given value is integer type.
ip()  : bool
Check if input is an ip value.
ipOrDomain()  : bool
Check if input is an ip or domain value.
isMySQL()  : bool
Function checks if its mysql type.
languageTag()  : bool
Function verifies if given value is a correct language tag.
naturalNumber()  : bool
Function verifies if given value is a natural number.
path()  : bool
Check path.
port()  : bool
Function checks if given value is port number.
sql()  : bool
Function checks if given value is valid SQl input.
standard()  : bool
Function verifies if given value is standard text.
text()  : bool
Function verifies if given value is text.
time()  : bool
Function verifies if given value is compatible with default time format.
timeInUserFormat()  : bool
Function verifies if given value is compatible with user’s time format.
timePeriod()  : bool
Check if input is an time period value.
url()  : bool
Function checks if given value is url.
urlDomain()  : bool
Function checks if given value is url or domain.

Methods

alnum()

Function verifies if given value contains only words or digits.

public static alnum(int|string $input) : bool
Parameters
$input : int|string
Return values
bool

alnumSpace()

Function verifies if given value contains only words, digits or space.

public static alnumSpace(int|string $input) : bool
Parameters
$input : int|string
Return values
bool

base64()

Check base64.

public static base64(string $input) : bool
Parameters
$input : string
Return values
bool

bool()

Function verifies if given value can be recognized as bool.

public static bool(bool|int|string $input) : bool
Parameters
$input : bool|int|string
Return values
bool

date()

Function verifies if given value is compatible with default data format.

public static date(string $input) : bool
Parameters
$input : string
Return values
bool

dateInUserFormat()

Function verifies if given value is compatible with user’s date format.

public static dateInUserFormat(string $input[, int|null $userId = null ]) : bool
Parameters
$input : string
$userId : int|null = null
Return values
bool

dateTime()

Function verifies if given value is compatible with default date and time format.

public static dateTime(string $input) : bool
Parameters
$input : string
Return values
bool

dateTimeInIsoFormat()

Function verifies if given value is compatible with date time in ISO format.

public static dateTimeInIsoFormat(string $input) : bool
Parameters
$input : string
Return values
bool

dateTimeInUserFormat()

Function verifies if given value is compatible with user’s date and time format.

public static dateTimeInUserFormat(string $input[, int|null $userId = null ]) : bool
Parameters
$input : string
$userId : int|null = null
Return values
bool

dbName()

Function checks if given value is correct database name (mysql).

public static dbName(string $input) : bool
Parameters
$input : string
Return values
bool

dbType()

Function checks if given value is database type.

public static dbType(string $input) : bool
Parameters
$input : string
Return values
bool

dbUserName()

Function checks if given value is valid db user name.

public static dbUserName(int|string $input) : bool
Parameters
$input : int|string
Return values
bool

dirName()

Check directory name.

public static dirName(string $input) : bool
Parameters
$input : string
Return values
bool

domain()

Function checks if given value is domain.

public static domain(string $input) : bool
Parameters
$input : string
Return values
bool

email()

Function checks if given value is email.

public static email(string $email) : bool
Parameters
$email : string
Return values
bool

emails()

Function checks if given value is email.

public static emails(string|array<string|int, mixed> $emails) : bool
Parameters
$emails : string|array<string|int, mixed>
Return values
bool

float()

Function verifies if given value is float type.

public static float(float|string $input) : bool
Parameters
$input : float|string
Return values
bool

floatIsEqual()

Check if floating point numbers are equal.

public static floatIsEqual(float $value1, float $value2[, int $precision = 2 ][, mixed $rounding = true ]) : bool
Parameters
$value1 : float
$value2 : float
$precision : int = 2
$rounding : mixed = true
Tags
see
https://www.php.net/manual/en/language.types.float.php
Return values
bool

floatIsEqualUserCurrencyDecimals()

Check if floating point numbers are equal. Get the precision of the number from the user's settings.

public static floatIsEqualUserCurrencyDecimals(float $value1, float $value2) : bool
Parameters
$value1 : float
$value2 : float
Return values
bool

fontIcon()

Check font icon name.

public static fontIcon(string $input) : bool
Parameters
$input : string
Return values
bool

integer()

Function verifies if given value is integer type.

public static integer(int|string $input) : bool
Parameters
$input : int|string
Return values
bool

ip()

Check if input is an ip value.

public static ip(string|array<string|int, string> $input) : bool
Parameters
$input : string|array<string|int, string>
Return values
bool

ipOrDomain()

Check if input is an ip or domain value.

public static ipOrDomain(string $input) : bool
Parameters
$input : string
Return values
bool

isMySQL()

Function checks if its mysql type.

public static isMySQL(string $dbType) : bool
Parameters
$dbType : string
Return values
bool

languageTag()

Function verifies if given value is a correct language tag.

public static languageTag(string $input) : bool
Parameters
$input : string
Return values
bool

naturalNumber()

Function verifies if given value is a natural number.

public static naturalNumber(int|string $input) : bool
Parameters
$input : int|string
Return values
bool

path()

Check path.

public static path(string $input) : bool
Parameters
$input : string
Return values
bool

port()

Function checks if given value is port number.

public static port(int $input) : bool
Parameters
$input : int
Return values
bool

sql()

Function checks if given value is valid SQl input.

public static sql(int|string $input) : bool
Parameters
$input : int|string
Return values
bool

standard()

Function verifies if given value is standard text.

public static standard(string $input) : bool
Parameters
$input : string
Return values
bool

text()

Function verifies if given value is text.

public static text(string $input) : bool
Parameters
$input : string
Return values
bool

time()

Function verifies if given value is compatible with default time format.

public static time(string $input) : bool
Parameters
$input : string
Return values
bool

timeInUserFormat()

Function verifies if given value is compatible with user’s time format.

public static timeInUserFormat(string $input[, int|null $userId = null ]) : bool
Parameters
$input : string
$userId : int|null = null
Return values
bool

timePeriod()

Check if input is an time period value.

public static timePeriod(string $input) : bool
Parameters
$input : string
Return values
bool

url()

Function checks if given value is url.

public static url(string $url) : bool
Parameters
$url : string
Return values
bool

urlDomain()

Function checks if given value is url or domain.

public static urlDomain(string $url) : bool
Parameters
$url : string
Return values
bool

        

Search results