Data Control Library



( ZN >= 5.0.0 )

The purpose of this library is to control the suitability of the incoming data. It was created by putting PHP's defined is_ * , filter_ * , ctype_ * functions and special methods together. This library will continue to expand to include all controls. So you will be fully aware of how you will perform the control you want.

 

# Methods


String software ( Void )
Bool timezone ( String $ timezone )
Bool phpVersion ( String $ version = '5.2.4' )
Bool import ( String $ file )
Bool url ( String $ url )
Bool email ( String $ email )
Bool realNumeric ( Mixed $ num = 0 )
Bool declaredClass ( String $ class )
Bool hash ( String $ type )
Bool charset ( String $ charset )
Bool array ( Mixed $ var )
Bool __call ( Mixed $ var )

 

# Software ( ZN >= 5.4.75 )


The server software used determines whether apache   is nginx .

Parameters

void
return String

uses

echo IS::software();
apache or nginx

 

# __Call ( ZN> 5.0.0 )


All is_ * methods can be used with this library.

Parameters

Mixed There are $ Variable to check.
return Bool

uses

The use of some methods is shown below.

TimeZone ( ZN >= 5.1.0 )

Checks whether the grant is one of the time zones.

echo IS::timeZone('Europe/Istanbul')
true
echo IS::timeZone('Asia/Istanbul')
false

PHPVersion ( ZN> = 5.0.0 )

Checks if the value is less than PHP_VERSION.

echo IS::phpVersion('5.3.0');
true
echo IS::phpVersion('7.1.8');
false

Import ( ZN >= 5.0.0 )

It checks to see if the file was previously included.

echo IS::import('zeroneed.php');
true
echo IS::import('abc.txt');
false

URL ( ZN >= 5.0.0 )

Checks whether the current URL information is valid.

echo IS::url('http://example.com');
true
echo IS::url('example.com');
false

Email ( ZN >= 5.0.0 )

Controls whether the grant is valid E-mail information.

echo IS::email('robot@znframework.com');
true
echo IS::url('robot@znframework');
false

Char ( ZN >= 5.0.0 )

Checks whether the output is output.

echo IS::char('example');
true
echo IS::char([]);
false

RealNumeric ( ZN >= 5.0.0 )

Checks whether the number is a real number.

echo IS::realNumeric(10);
true
echo IS::realNumeric('10');
false

DeclaredClass ( ZN >= 5.0.0 )

Checks whether the class has been included before.

$get = DB::get('tableName');

echo IS::declaredClass('DB');
true
echo IS::declaredClass('Pagination');
false

Hash ( ZN >= 5.0.0 )

Checks whether the certificate is one of the current encryption algorithms.

echo IS::hash('md5');
true
echo IS::hash('sha10');
false

# Charset ( ZN >= 5.0.0 )

Controls whether the verifier is one of the current character sets.

echo IS::charset('utf-8');
true
echo IS::charset('utf-9');
false

Aluminum ( ZN >= 5.0.0 )

Alpha performs numeric character checking. That is, the data must be either alphabetic characters, numbers, or both.

echo IS::alnum('example5');
true
echo IS::alnum('example 5');
false

Alpha ( ZN >= 5.0.0 )

Alphabetical character control.

echo IS::alpha('example');
true
echo IS::alpha('example5');
false

Digit ( ZN >= 5.0.0 )

Checks the number.

echo IS::digit(10);
true
echo IS::digit('10a');
false

xDigit ( ZN >= 5.0.0 )

The data should only consist of 16 characters. Soa, b, c, d, e, f, and 0-9 characters.

echo IS::xdigit('AABB10');
true
echo IS::xdigit('AAZZ10');
false

Punct ( ZN >= 5.0.0 )

The data may only contain alphanumeric or non-space characters.

echo IS::punct('##$');
true
echo IS::punct('#A10$');
false

Graph ( ZN >= 5.0.0 )

The data should only consist of printable characters except spaces. So\ r, \ t can not be used.

echo IS::graph('zeroneed5');
true
echo IS::graph('zero need 5');
false

Print ( ZN >= 5.0.0 )

The data should only consist of printable characters. So\ r, \ t can not be used.

echo IS::print('zero need 5');
true
echo IS::print("zero\tneed");
false

Lower ( ZN >= 5.0.0 )

The data should only consist of lowercase letters.

echo IS::lower('znframework');
true
echo IS::lower('zn framework');
false

Upper ( ZN >= 5.0.0 )

The data should only consist of uppercase letters.

echo IS::lower('ZERONEED');
true
echo IS::lower('ZERO NEED');
false

Space ( ZN >= 5.0.0 )

The data should only consist of space characters.

echo IS::space(" \n\t");
true
echo IS::space("\n ZN");
false

Cntrl ( ZN >= 5.0.0 )

Data must consist only of control characters. That is, \xit should consist of the characters.

echo IS::cntrl("\n\t");
true
echo IS::cntrl("\n ");
false

NAN ( ZN >= 5.0.0 )

Find a value is not a number.

echo IS::nan(NAN);
true
echo IS::nan(10);
false

Dir ( ZN >= 5.0.0 )

Checks whether the given directory exists.

echo IS::dir(VIEWS_DIR);
true
echo IS::dir('Example');
false

File ( ZN >= 5.0.0 )

Checks whether the file is a file.

echo IS::file(VIEWS_DIR . 'home/main.php');
true
echo IS::dir(VIEWS_DIR);
false